Writing a Simple SOAP Client

Discussion in 'Ruby' started by junk6@microserf.org.uk, Jun 6, 2006.

  1. Guest

    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.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
    , Jun 6, 2006
    #1
    1. Advertising

  2. gregarican Guest

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


    Hope this helps!

    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.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
    gregarican, Jun 6, 2006
    #2
    1. Advertising

  3. Guest

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


    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
    , Jun 6, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sham Ramakrishnan
    Replies:
    2
    Views:
    8,354
    Sham Ramakrishnan
    Jul 1, 2003
  2. Alvin A. Delagon

    Writing python SOAP client

    Alvin A. Delagon, Oct 20, 2005, in forum: Python
    Replies:
    0
    Views:
    508
    Alvin A. Delagon
    Oct 20, 2005
  3. Bruce

    client-to-client communication via SOAP

    Bruce, Mar 21, 2005, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    249
    [MSFT]
    Mar 28, 2005
  4. Replies:
    6
    Views:
    156
    Tony Arcieri
    Nov 4, 2010
  5. Mason Brown
    Replies:
    1
    Views:
    366
Loading...

Share This Page