SOAP4R WSDL response

Discussion in 'Ruby' started by Jim Menard, May 29, 2004.

  1. Jim Menard

    Jim Menard Guest

    I'm trying to use wsdlDriver.rb to call a Web service. I have a WSDL
    file. When I run my script, it connects to the Web service, calls the
    operation I specify ("approve"), and receives the response string.
    However, it doesn't put the response string into the message part that
    the operation "approve" uses as its output message. Instead, it tries
    to find something called "approveResponse", which is not described in
    the WSDL file. I see the following error:

    c:/ruby/lib/ruby/1.8/wsdl/soap/complexType.rb:69:in
    `child_defined_complextype': Cannot find
    {http://www.w3.org/2001/XMLSchema}string as a children of
    {http://loans.org/wsdl/loan-approval}approveResponse. (RuntimeError)
    from c:/ruby/lib/ruby/1.8/soap/encodingstyle/soapHandler.rb:382:in
    `decode_tag_by_wsdl'
    ...

    Why isn't the response string being put into the message part that the
    operation "approve" uses as its output message?

    Jim
    --
    Jim Menard, , http://www.io.com/~jimm/
    "COGITO, EGGO SUM." I think, therefore I am a waffle.
    -- .sig of Mr. Ska on Slashdot.org
     
    Jim Menard, May 29, 2004
    #1
    1. Advertising

  2. Jim Menard

    Jim Menard Guest

    Hate to reply to my own question, but I've learned something about what
    was going wrong. Instead, I have a new question.

    On May 29, 2004, at 5:55 PM, I wrote:

    > I'm trying to use wsdlDriver.rb to call a Web service. I have a WSDL
    > file. When I run my script, it connects to the Web service, calls the
    > operation I specify ("approve"), and receives the response string.
    > However, it doesn't put the response string into the message part that
    > the operation "approve" uses as its output message. Instead, it tries
    > to find something called "approveResponse", which is not described in
    > the WSDL file. I see the following error:
    >
    > c:/ruby/lib/ruby/1.8/wsdl/soap/complexType.rb:69:in
    > `child_defined_complextype': Cannot find
    > {http://www.w3.org/2001/XMLSchema}string as a children of
    > {http://loans.org/wsdl/loan-approval}approveResponse. (RuntimeError)
    > from c:/ruby/lib/ruby/1.8/soap/encodingstyle/soapHandler.rb:382:in
    > `decode_tag_by_wsdl'
    > ...


    It turns out that the WSDL didn't match the reply from the server. The
    reply body is

    <ns1:approveResponse soapenv:encodingStyle="..." xmlns:ns1="...">
    <xsd:string>approved</xsd:string>
    </ns1:approveResponse>

    Now, the WSDL for the reply message used to be

    <message name="approvalMessage">
    <part name="accept" type="xsd:string"/>
    </message>

    so I tried changing that to

    <message name="approvalMessage">
    <part name="approveResponse" type="xsd:string"/>
    </message>

    but that didn't work. I saw the same error message ("can't find string
    as child of approveResponse"). So I tried


    <message name="approvalMessage">
    <part name="string" type="xsd:string"/>
    </message>

    and it worked! Now I need to figure out why I have to call the part
    "string". Does anyone know what is going on here?

    Thanks for your help.

    Jim
    --
    Jim Menard, , http://www.io.com/~jimm/
    "Dvorak users of the world flgkd!" -- Kirsten Chevalier in
    rec.humor.oracle.d
     
    Jim Menard, May 29, 2004
    #2
    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. Brian Marick
    Replies:
    1
    Views:
    152
    NAKAMURA, Hiroshi
    Nov 7, 2003
  2. Ian Macdonald

    SOAP4R and WSDL

    Ian Macdonald, Jan 17, 2004, in forum: Ruby
    Replies:
    8
    Views:
    192
    Ian Macdonald
    Jan 19, 2004
  3. Lennon Day-Reynolds

    SOAP4R+WSDL+HTTP proxies?

    Lennon Day-Reynolds, Aug 13, 2004, in forum: Ruby
    Replies:
    2
    Views:
    310
    Lennon Day-Reynolds
    Aug 14, 2004
  4. Michael Gebhart

    Soap4r and wsdl

    Michael Gebhart, May 11, 2005, in forum: Ruby
    Replies:
    1
    Views:
    109
    Michael Gebhart
    May 11, 2005
  5. Ian Neubert
    Replies:
    1
    Views:
    122
    Payal Patel
    Dec 8, 2010
Loading...

Share This Page