axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anne Thomas Manes <>
Subject Re: wrapped/literal: complex return value
Date Sat, 15 Jan 2005 03:06:54 GMT
<soap:Body> cannot contain text content, so the response must be
returned as a child element of the <soap:Body>. Also, when using
wrapped or document, the message part must reference an element, not a

So what I'm saying is that wrapped/literal is doc/literal. Elements
that you define as your request and response message parts are what
will be sent as the child element of the <soap:Body>. e.g.:

<wsdl:message name="getUserRequest">
 <wsdl:part name="parameters" element="tns:getUser"/>

results in:

   <tns:getUser xmlns:tns="..." />

<wsdl:message name="getUserResponse">
 <wsdl:part name="parameters" element="tns:user"/>

results in 

   <tns:user xmlns:tns="..." />

Whether using wrapped or document style, the <soap:Body> must contain
at most one direct child element. (i.e., at most one body part). When
using wrapped, the convention is that the request message body part
element has the same name as the operation name. There's no specific
convention for the return message, but it should map to the return
value for the operation.

When using document, the request message body part doesn't have the
same name as the operation, but it still must contain at most one


On Thu, 13 Jan 2005 12:43:03 +0900, Bill Keese
<> wrote:
> 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"/>
> Anne Thomas Manes wrote: 
> If you want your return value to be a User object, then that should be
> return structure, not getUserResponse.
> i.e.,

<name>John Smith</name>
<address>10 Main
> St.</address>

The output message should be defined
> so:

<wsdl:message name="getUserResponse">
 <wsdl:part name="parameters"
> element="tns:user"/>

- Anne

On Wed, 12 Jan 2005 18:41:24
> +0900, Bill Keese
<> 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

> 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:

> Smith</name>
<address>10 Main
> St.</address>

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; }

> Has anyone gotten this to work with Axis? I hand-wrote my WSDL file,
> 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
> think <getUserResponse> is parallel to the <getUser> (wrapper tag),
> <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

> anyone comment on these things? Thanks!

View raw message