From: "bmunat@..." Date: 2007-06-14T12:10:12+09:00 Subject: Re: Ruby Syntax and SOAP Web Service I never did find a decent tutorial on using SOAP in Ruby. However, I did find bits and pieces in blogs and list archives. There's actually quite a bit of information in the SOAP4r trac (the Ruby SOAP code *is* SOAP4r): http://dev.ctor.org/soap4r The biggest "ah-hah" moment for me was figuring out that you don't have generate a bunch of classes from WSDL in Ruby like in other languages... you can, but Ruby is dynamic enough that you can just create a driver instance from the WSDL and all the signatures in that WSDL become available as method calls on the driver [1]. Similarly, the SOAP response object is accessible as a nested hash of data or as pseudo-method calls. Hope this helps some! Ben [1] Here's how I created my driver: soap_driver = SOAP::WSDLDriverFactory.new(RAILS_ROOT + '/config/ somewebservice.wsdl').create_rpc_driver Then I can call every SOAP call listed in that wsdl just by calling the name on the driver: response = soap_driver.someWebService({ hash of params }) On Jun 13, 2:11 pm, David wrote: > I need a good tutorial to show how to create a RUBY > SOAP request when I have an example SOAP request file. The example in my > book is next to useless. Also, how can I see that SOAP xml is being sent > and the client response? > > An example, I am attempting to call this service > (http://www.webservicex.net/uszip.asmx?op=GetInfoByZIP). > > What I need to know is which namespace to use for the request. Also, do I > need to add anything to specify the Envelope namespaces. > > Thanks > > P.S. > This is the example Soap request. > > POST /uszip.asmx HTTP/1.1 > Host:www.webservicex.net > Content-Type: text/xml; charset=utf-8 > Content-Length: length > SOAPAction: "http://www.webserviceX.NET/GetInfoByZIP" > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > > > string > > >