Definitely not a Watir question, more of related to Savon or general ruby
lists. That being said, I've done soap service testing with Soap4R, which
isn't a great library and had considered moving to Savon. It's been a long
time since I looked at it, but hacked together a quick example given the
Savon docs and found this as well:
http://blog.nofail.de/2010/01/savon-handsoap-shootout/

Seems pretty trivial to do, here's my quick example from a free soap
webservice:

require 'rubygems'
require 'savon'
require 'pp'

client = Savon::Client.new "
http://geocoder.us/dist/eg/clients/GeoCoderPHP.wsdl";

response = client.geocode_address do |soapy|
  soapy.body = {:location => '1600 Pennsylvania Av, Washington, DC'}
end
pp response.to_hash



I don't know if that helps, but should give you some start. Savon docs are
pretty good, took 10 minutes from installing the gem to finding a free web
service to writing this. If you see the response back, it's hash within hash
within hash, etc. I'm assuming the same is for input so in your example
something like setting the body to (pseudocode):

{:from_date => 'whatever', :to_date => 'sometime later', :service_address =>
{:address1 => '123'}} etc etc

should theoretically work.

 Once again, this is unsupported hacky code, you're much better off asking
elsewhere. :) Might make for a good blog post though, hrrrm... :)


Charley Baker
Lead Developer, Watir, http://watir.com


On Fri, Aug 13, 2010 at 9:57 AM, jtk <jeff.kr...@gmail.com> wrote:

> For a project at work I need the ability to submit transactions using
> soap calls. I tried searching the group and the only posts I could
> find were for soap4r. From what I've read soap4r does not work well
> and I found a gem called savon. Supposedly it's easier and more
> lightweight than soap4r but I can't find any basic examples of simply
> submitting a soap request. All the examples I do find are more
> complicated than this where the writers are trying to do something
> quite more involved.
>
> Can anyone here show me a simple request of submitting a soap request
> using savon?
>
> We are using basic auth no ssl and my soap envelope has no header.
>
> Here is the call I am making
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
> envelope/" xmlns:ser="http://service.webservice.com/";>
>   <soapenv:Header/>
>   <soapenv:Body>
>      <ser:getAvailableInstallDates>
>         <!--Optional:-->
>         <fromDate>2010-08-13</fromDate>
>         <!--Optional:-->
>         <toDate>2010-08-23</toDate>
>         <!--Optional:-->
>         <serviceAddress>
>            <!--Optional:-->
>            <address1>?</address1>
>            <!--Optional:-->
>            <address2>?</address2>
>            <!--Optional:-->
>            <city>?</city>
>            <!--Optional:-->
>            <county>?</county>
>            <!--Optional:-->
>            <state>CA</state>
>            <!--Optional:-->
>            <zip>93230</zip>
>            <!--Optional:-->
>            <zipFour></zipFour>
>         </serviceAddress>
>         <!--Optional:-->
>         <salesChannel>DIRECT</salesChannel>
>      </ser:getAvailableInstallDates>
>   </soapenv:Body>
> </soapenv:Envelope>
>
>
> All I want to do is submit this to an endpoint and capture the
> response. If someone could show me a simple example I would greatly
> appreciate it.
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> You received this message because you are subscribed to
> http://groups.google.com/group/watir-general
> To post: watir-general@googlegroups.com
> To unsubscribe: 
> watir-general+unsubscr...@googlegroups.com<watir-general%2bunsubscr...@googlegroups.com>
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com

Reply via email to