Cool, thanks! Are you implying that document/literal and
wrapped/literal are the same w.r.t. the return value? The difference
is only for the request?
Also, does your answer implay that a scalar return value can be
represented simply like this?
<soapenv:Body>
Hello World!
</soapenv:Body>
And the WSDL would be this?
<wsdl:message name="getUserResponse">
<wsdl:part name="parameters" type="xsd:string"/>
</wsdl:message>
Bill
Anne Thomas Manes wrote:
If you want your return value to be a User object, then that should be
your return structure, not getUserResponse. i.e.,
<soapenv:Body>
<user>
<name>John Smith</name>
<address>10 Main St.</address>
</user>
</soapenv:Body>
The output message should be defined so:
<wsdl:message name="getUserResponse">
<wsdl:part name="parameters" element="tns:user"/>
</wsdl:message>
- Anne
On Wed, 12 Jan 2005 18:41:24 +0900, Bill Keese
<[EMAIL PROTECTED]> wrote:
I have a few questions about return values from a method in a
wrapped/literal server.
(1) My getUser() method returns a structure:
User getUser(String id);
I know that for wrapped/literal the input message should be
<soapenv:Body>
<getUser>
<id>jsmith</id>
</getUser>
</soapenv:Body>
What should the response be, such that a client's generated stubs (for
wrapped/literal mode) don't contain any unnecessary structures? IE, if
this is the return value:
<soapenv:Body>
<getUserResponse>
<user>
<name>John Smith</name>
<address>10 Main St.</address>
</user>
</getUser>
</soapenv:Body>
Will .NET generate a function stub like this?
User getUser(String id)
or will it generate a stub like this?
GetUserResponse getUser(String id);
where GetUserResponse is a dummy wrapper class like this:
class GetUserResponse { User user; }
(2) Has anyone gotten this to work with Axis? I hand-wrote my WSDL file,
and then used WSDL2Java to generate the deploy.wsdd file. I see two
problems in my testing but I wonder if anyone can confirm or deny.
a) Axis seems to want to print 2 nested tags
<soapenv:Body>
<getUserResponse>
<getUserResult>
...
</getUserResult>
</getUserResponse
I think <getUserResponse> is parallel to the <getUser> (wrapper tag),
and <getUserResult> is possibly to differentiate between the return
value and output parameters.
b) The <user> tag itself is not printed; only the fields inside of the
User class are printed. It's as though Axis is assuming the User class
is a wrapper class that contains a list of output values
Can anyone comment on these things? Thanks!
Bill
|