multiple output parameters in SOAP

Discussion in 'Ruby' started by Jacob Maine, Jul 26, 2006.

  1. Jacob Maine

    Jacob Maine Guest

    Hi all,

    Apologies for the cross-posting to the Rails mailing list - I looked deeper
    into Action Web Service and realized it probably isn't going to do what I
    want.

    I'm trying to use soap4r to write a web service server that will return
    multiple output parameters - something like the following:

    <?xml version="1.0" encoding="UTF-8" ?>
    <Envelope>
    <Body>
    <doSomethingResponse>
    <returnCode type="int">0</returnCode>
    <returnText type="string">Success</returnText>
    </doSomethingResponse>
    </Body>
    </Envelope>

    This form is mentioned briefly in the W3C SOAP spec
    http://www.w3.org/TR/soap12-part0/#L1185 and again at
    http://www.w3.org/TR/soap12-part0/#Example5. I wish I could use a struct or
    array to wrap these responses, but I'm re-writing an existing web service,
    and the existing clients won't be able to interpret this:

    <?xml version="1.0" encoding="UTF-8" ?>
    <Envelope>
    <Body>
    <doSomethingResponse>
    <return type="ReturnStatus">
    <returnText type="string">Success</returnText>
    <returnCode type="int">0</returnCode>
    </return>
    </doSomethingResponse>
    </Body>
    </Envelope>

    The extra <return> tag, representing an instance of a ReturnStatus struct,
    is getting in the way. The problem seems to be that since Ruby functions
    always return one value (possibly an object with attributes) the soap4r
    implementation always sets that object as the only child of the web service
    response tag. Is there a way to define a mapping that will leave an element
    out, but encode its children? Or some other way to return multiple
    un-wrapped values?

    Thanks in advance for your help.

    Jacob Maine
    Jacob Maine, Jul 26, 2006
    #1
    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,357
    Sham Ramakrishnan
    Jul 1, 2003
  2. mooseshoes

    To SOAP or Not To SOAP?

    mooseshoes, Sep 4, 2003, in forum: XML
    Replies:
    3
    Views:
    396
    Heinz Häberle
    Sep 21, 2003
  3. Nagesh
    Replies:
    2
    Views:
    9,385
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Aug 12, 2006
  4. comp.text.xml
    Replies:
    0
    Views:
    507
    comp.text.xml
    Sep 20, 2006
  5. Amogh Hooshdar

    any library for SOAP 1.1 or SOAP 1.2?

    Amogh Hooshdar, Jan 25, 2008, in forum: Python
    Replies:
    1
    Views:
    388
    Paul Watson
    Mar 11, 2008
Loading...

Share This Page