multiple output parameters in SOAP

J

Jacob Maine

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top