[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Writing a Simple SOAP Client

junk6

6/6/2006 7:37:00 PM

Hi

I'm having problems finding a basic tutorial on writing a SOAP client
in Ruby (and getting what I have found to work). This isn't a Rails
thing, just a command-line client.

So far, I have:

require 'soap/wsdlDriver'
factory = SOAP::WSDLDriverFactory.new('http://my.domain.com/wsdl...)
soap = factory.create_driver
soapResponse = soap.getWidget(:widgetName => 'my-widget')

(where getWidget is a SOAP method which takes an argument called
widgetName which must be a string).

This seems to work fine until the last line, where I get told that
"TypeError: cannot convert Hash into String".

How do I call my getWidget method?

The getWidget method returns a stream of bytes (a byte[] in
JWS-speak)---how do I get at those bytes once the method has returned?

Thanks in advance

C

2 Answers

greg.kujawa

6/6/2006 7:50:00 PM

0

Here's an URL that lists an example --->
http://searchwebservices.techtarget.com/tip/1,289483,sid26_gci11807....


Hope this helps!

junk6@microserf.org.uk wrote:
> Hi
>
> I'm having problems finding a basic tutorial on writing a SOAP client
> in Ruby (and getting what I have found to work). This isn't a Rails
> thing, just a command-line client.
>
> So far, I have:
>
> require 'soap/wsdlDriver'
> factory = SOAP::WSDLDriverFactory.new('http://my.domain.com/wsdl...)
> soap = factory.create_driver
> soapResponse = soap.getWidget(:widgetName => 'my-widget')
>
> (where getWidget is a SOAP method which takes an argument called
> widgetName which must be a string).
>
> This seems to work fine until the last line, where I get told that
> "TypeError: cannot convert Hash into String".
>
> How do I call my getWidget method?
>
> The getWidget method returns a stream of bytes (a byte[] in
> JWS-speak)---how do I get at those bytes once the method has returned?
>
> Thanks in advance
>
> C

junk6

6/6/2006 8:13:00 PM

0

> Here's an URL that lists an example --->
> http://searchwebservices.techtarget.com/tip/1,289483,sid26_gci11807....

Thanks, I found this via Google and the example didn't work for me.
However, I tried it on another computer and found it did work; the
difference seems to be the version of Ruby---on my original machine I
had 1.8.2 and the other machine is running 1.8.3.

Thanks anyway.

C