axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Keese <bi...@tech.beacon-it.co.jp>
Subject Re: wrapped/literal: complex return value
Date Thu, 13 Jan 2005 03:43:03 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Cool, thanks!&nbsp;&nbsp; Are you implying that document/literal and
wrapped/literal are the same w.r.t. the return value?&nbsp; The difference
is only for the request?<br>
<br>
Also, does your answer implay that a scalar return value can be
represented simply like this?<br>
<br>
&lt;soapenv:Body&gt;<br>
&nbsp; Hello World!<br>
&lt;/soapenv:Body&gt;<br>
<br>
And the WSDL would be this?<br>
<pre wrap="">&lt;wsdl:message name="getUserResponse"&gt;
 &lt;wsdl:part name="parameters" type="xsd:string"/&gt;
&lt;/wsdl:message&gt;
</pre>
Bill<br>
<br>
Anne Thomas Manes wrote:
<blockquote cite="midbf414ee6050112165928f783f7@mail.gmail.com"
 type="cite">
  <pre wrap="">If you want your return value to be a User object, then that should be
your return structure, not getUserResponse. i.e.,

&lt;soapenv:Body&gt;
&lt;user&gt;
&lt;name&gt;John Smith&lt;/name&gt;
&lt;address&gt;10 Main St.&lt;/address&gt;
&lt;/user&gt;
&lt;/soapenv:Body&gt;


The output message should be defined so:

&lt;wsdl:message name="getUserResponse"&gt;
 &lt;wsdl:part name="parameters" element="tns:user"/&gt;
&lt;/wsdl:message&gt;

- Anne

On Wed, 12 Jan 2005 18:41:24 +0900, Bill Keese
<a class="moz-txt-link-rfc2396E"
 href="mailto:billk@tech.beacon-it.co.jp">&lt;billk@tech.beacon-it.co.jp&gt;</a>
wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">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
&lt;soapenv:Body&gt;
&lt;getUser&gt;
&lt;id&gt;jsmith&lt;/id&gt;
&lt;/getUser&gt;
&lt;/soapenv:Body&gt;

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:

&lt;soapenv:Body&gt;
&lt;getUserResponse&gt;
&lt;user&gt;
&lt;name&gt;John Smith&lt;/name&gt;
&lt;address&gt;10 Main St.&lt;/address&gt;
&lt;/user&gt;
&lt;/getUser&gt;
&lt;/soapenv:Body&gt;

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
&lt;soapenv:Body&gt;
&lt;getUserResponse&gt;
&lt;getUserResult&gt;
...
&lt;/getUserResult&gt;
&lt;/getUserResponse
I think &lt;getUserResponse&gt; is parallel to the &lt;getUser&gt; (wrapper
tag),
and &lt;getUserResult&gt; is possibly to differentiate between the return
value and output parameters.

b) The &lt;user&gt; 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

    </pre>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
</blockquote>
</body>
</html>

Mime
View raw message