Multiple output parameters in SOAP

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

Hi,

Sorry for late reply. I don't know AWS so you may need to investigate
AWS thing more...

Jacob Maine wrote:

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>

It can be a document/literal service. You really want to do rpc/encoded
service + output parameter?

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?

Here is the WSDL I know that uses rpc/encoded + output parameter.
http://api.map-and-go.com/3.3/server?wsdl
(It's not mine and it's just an example WSDL for this case I know.
Please do not contact to the owner about this.)

Run wsdl2ruby.rb against the WSDL and see mms_MizGIS.rb how you can
define a service with output parameter.

Regards,
// NaHi