You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ephemeris Lappis <ep...@tiscali.fr> on 2004/12/23 07:54:23 UTC

Document/Literal : bad part name in axis server response

Before i open a bug, i'd like to have the opinion of experts !
All my last tests around document/literal style let me with troubles. To
start again with simple things, i have made a basic service to evaluate the
primary interoperability with my J2ME client. This simple service provides a
single operation that takes a string, reverses it and return it.
On the client side, i work with the SUN Wireless toolkit that support the
JSR172 (web-service for J2ME). Using the axis wsdl i have successfully
generated the j2me client stubs, and built my midlet to call the web
service. At run time, the client reports an error in the server response :
the name of the response part for the return value is not as defined in the
wsdl descriptor. To be sure, i had made the test again putting the tcp
monitor in the middle... and it seems the client is right !
The name of the part in the wsdl is 'reverseReturn' and axis uses
'in0Return'...
Is it a bug, or just another mis-interpretation of mine ?
Thanks to give your opinion before i open an unnecessary bug report...


Here the java code :

--- java interface ---
package net.moon.me.five.ws;

import java.rmi.Remote;
import java.rmi.RemoteException;

public interface StringTool extends Remote {

	public String reverse(String string) throws RemoteException;

}
----------------------

I have successfully generated the wsdl with the following ant script :

--- wsdl2java ant script ---
<property name="my.namespace" value="http://ws.moon.net/j2me05" />
<java2wsdl output="./wsdl/j2me05ws.wsdl"
           className="net.moon.me.five.ws.StringTool"
           namespace="${my.namespace}"
           porttypename="StringUtility"
           serviceportname="StringUtilityPort"
           serviceelementname="J2ME05"
           style="DOCUMENT"
           location="http://ws.moon.net/j2me05">
	<classpath>
		<pathelement location="${my.services.compile-directory}" />
		<path refid="my.axis.classpath" />
	</classpath>
</java2wsdl>
----------------------------

The resulting WSDL, with the expected part names !

--- WSDL ---
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ws.moon.net/j2me05"
xmlns:impl="http://ws.moon.net/j2me05"
xmlns:intf="http://ws.moon.net/j2me05"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--WSDL created by Apache Axis version: 1.2RC2
Built on Nov 16, 2004 (12:19:44 EST)-->
 <wsdl:types>
  <schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://ws.moon.net/j2me05" elementFormDefault="qualified">
   <element name="in0" type="xsd:string"/>
   <element name="reverseReturn" type="xsd:string"/>
  </schema>
 </wsdl:types>

   <wsdl:message name="reverseRequest">

      <wsdl:part name="in0" element="impl:in0"/>

   </wsdl:message>

   <wsdl:message name="reverseResponse">

      <wsdl:part name="reverseReturn" element="impl:reverseReturn"/>

   </wsdl:message>

   <wsdl:portType name="StringUtility">

      <wsdl:operation name="reverse" parameterOrder="in0">

         <wsdl:input name="reverseRequest" message="impl:reverseRequest"/>

         <wsdl:output name="reverseResponse"
message="impl:reverseResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="StringUtilityPortSoapBinding"
type="impl:StringUtility">

      <wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="reverse">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="reverseRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="reverseResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="J2ME05">

      <wsdl:port name="StringUtilityPort"
binding="impl:StringUtilityPortSoapBinding">

         <wsdlsoap:address location="http://ws.moon.net/j2me05"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>
-------------------------------------

And now, the dumped http request and response :

--- request ---
POST /j2me05ws-ejb/J2ME-05-WS/J2ME05WS HTTP/1.1
User-Agent: Profile/MIDP-1.0 Configuration/CLDC-1.0
Content-Language: en-US
Content-Type: text/xml
SOAPAction: "
Content-Length: 315
Host: localhost

<?xml version="1.0" encoding="utf-8"?>
   <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="http://ws.moon.net/j2me05">
      <soap:Body>
         <tns:in0>ABC</tns:in0>
      </soap:Body>
   </soap:Envelope>
---------------

--- response ---
HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=75C329A6CED0EE74D896E083043AFA0A; Path=/j2me05ws-ejb
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Tue, 21 Dec 2004 14:15:18 GMT
Server: Apache-Coyote/1.1

123
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <in0Return xmlns="http://ws.moon.net/j2me05">CBA</in0Return>
   </soapenv:Body></soapenv:Envelope>
0
----------------


Re: Document/Literal : bad part name in axis server response

Posted by Anne Thomas Manes <at...@gmail.com>.
It's a convention used by .NET to add the extra layer of wrapping on
the response.


On Thu, 13 Jan 2005 10:55:13 +0900, Bill Keese
<bi...@tech.beacon-it.co.jp> wrote:
> Thanks for the correction!  It makes sense.  (It also partially addresses
> the other question I recently sent out.)  Until the Axis bug gets fixed I
> guess I should modify the WSDL file to match Axis' output?
> 
> Also, could you tell me why, for example, the webservice
> http://ws2.serviceobjects.net/nw/namewizard.asmx?WSDL embeds a
> <getNameInfoResult> inside of a <getNameInfoResponse>?  It seems like only
> one of the two tags is necessary.  Is it unnecessary overhead, or is it
> something to make certain client tools happy?
> 
> 
> Bill
> 
> Anne Thomas Manes wrote: 
> Clarification:

 
> Bug: In document/literal mode, Axis generate a <methodNameReturn> tag
> when
writing out the return value; it shouldn't. That tag only makes sense
> in 
wrapped/literal mode. (This is what Ann was saying.)
 Axis should
> generate a <methodNameReturn> tag only when using RPC
style. It should not
> generate the tag when using either wrapped or
document style. In both cases,
> the child element of the SOAP Body
should be the element specified in the
> response message part. For
example, if the response message is defined
> as:

<wsdl:message name="methodResponse">
 <wsdl:part name="parameters"
> element="tns:foo"/>
</wsdl:message>

then the response message for either
> wrapped or document style should be:

<s:Body>
 <tns:foo.../>
</s:Body>

-
> Anne



On Wed, 12 Jan 2005 09:38:49 +0900, Bill
> Keese
<bi...@tech.beacon-it.co.jp> wrote:
 
> OK, I think I understand what's going on now. There is both a bug and
> a
"missing feature".

Bug: In document/literal mode, Axis generate a
> <methodNameReturn> tag when
writing out the return value; it shouldn't. That
> tag only makes sense in
wrapped/literal mode. (This is what Ann was
> saying.)

Missing feature: Axis obeys the specifications in the WSDL file,
> but you
have to manually call wsdl2java to generate the deploy.wsdd. (This
> is what
Michael was saying.) However, I would like a feature where
> Axis
automatically parses and obeys the WSDL file, without manually
> calling
wsdl2java.

Bill

-----Message d'origine-----
 De : Michael
> Schuerig
 
> [mailto:michael@schuerig.de]
 Envoyé : mardi 11 janvier 2005 11:51
À :
 
> axis-user@ws.apache.org
 Objet : Re: Document/Literal : bad part name in
> axis
 
> server response
 
On Tuesday 11 January 2005 07:26, Ephemeris Lappis wrote:
> I don't use wsdl2java.
 I had it the wrong way around and confused the
 
> java2wsdl from your
 original message with wsdl2java.

 
 
> In Jonas, using the new (not so new) ejb 2.1 service endpoint
 features, i
 
> just provide the wsdl (that is generated from the java
 endpoint
> interface),
 
> and the ejb and webservices descriptors (for the
 ejb deployment). At
 
> assembly time, Jonas produces the java stubs, the
 whole web application as
> a
 
> war with a limited wsdd descriptor. At
 deployment time, Jonas merges the
 
> war's wsdd file with the full
 platform's one to expose the web service
 
> endpoint. This is the wsdd
 file :
 Presumably the following is happening:
> At
 
> assembly time Jonas uses
 wsdl2java to generate, among other things, a
 
> deploy.wsdd. At deployment
 time, Jonas uses the Axis AdminClient to merge
 
> this deploy.wsdd into
 Axis' server-config.wsdd. Do you know if this is
 
> correct?
 
 
> <?xml version="1.0" encoding="UTF-8"?>
 <deployment
 
> xmlns="http://xml.apache.org/axis/wsdd/"
 [snip]
 
 
> </deployment>
 There are no operation elements in that WSDD. Without them,
 
> Axis won't
 use the names and types you intended in the input and output
 
> messages.
 
 
> From my point of view, Axis was expected to use the given wsdl file
 to
 
> handle client requests according to the descriptor it generated
 itself...
 
> Well, Axis (at least as of 1.2RC) does that. Not directly, though. You
> need
 
> to process your WSDL with wsdl2java and among other things, you
 get a
 
> deploy.wsdd with names, types and namespaces specified for
 operations.
> Also,
 
> the deployScope can be specified.
 I may be mistaken and I can't claim that
> Axis is doing
 everything right,
but the problem in your case appears to be
> one of integration where the
 Jonas installation doesn't make full use of
 
> what Axis offers. I don't
 know Jonas, thus I can't say whether this is a
 
> genuine limitation of
 the respective Jonas version or a shortcoming of the
> deployment.
 Michael

--
Michael Schuerig Contests between male toads over
 
> females are
 mailto:michael@schuerig.de often settled by the depth of the
 
> croak.
 http://www.schuerig.de/michael/ --John Maynard Smith

Re: Document/Literal : bad part name in axis server response

Posted by Anne Thomas Manes <at...@gmail.com>.
Clarification:

> Bug: In document/literal mode, Axis generate a <methodNameReturn> tag when
> writing out the return value;  it shouldn't.  That tag only makes sense in 
> wrapped/literal mode.  (This is what Ann was saying.)

Axis should generate a <methodNameReturn> tag only when using RPC
style. It should not generate the tag when using either wrapped or
document style. In both cases, the child element of the SOAP Body
should be the element specified in the response message part. For
example, if the response message is defined as:

<wsdl:message name="methodResponse">
  <wsdl:part name="parameters" element="tns:foo"/>
</wsdl:message>

then the response message for either wrapped or document style should be:

<s:Body>
  <tns:foo.../>
</s:Body>

- Anne



On Wed, 12 Jan 2005 09:38:49 +0900, Bill Keese
<bi...@tech.beacon-it.co.jp> wrote:
> OK, I think I understand what's going on now.  There is both a bug and a
> "missing feature".
> 
> Bug: In document/literal mode, Axis generate a <methodNameReturn> tag when
> writing out the return value;  it shouldn't.  That tag only makes sense in
> wrapped/literal mode.  (This is what Ann was saying.)
> 
> Missing feature: Axis obeys the specifications in the WSDL file, but you
> have to manually call wsdl2java to generate the deploy.wsdd.  (This is what
> Michael was saying.) However, I would like a feature where Axis
> automatically parses and obeys the WSDL file, without manually calling
> wsdl2java.
> 
> Bill
> 
> -----Message d'origine-----
De : Michael Schuerig
> [mailto:michael@schuerig.de]
Envoyé : mardi 11 janvier 2005 11:51
À :
> axis-user@ws.apache.org
Objet : Re: Document/Literal : bad part name in axis
> server response


On Tuesday 11 January 2005 07:26, Ephemeris Lappis wrote:
> I don't use wsdl2java.
 I had it the wrong way around and confused the
> java2wsdl from your
original message with wsdl2java.

 
> In Jonas, using the new (not so new) ejb 2.1 service endpoint
features, i
> just provide the wsdl (that is generated from the java
endpoint interface),
> and the ejb and webservices descriptors (for the
ejb deployment). At
> assembly time, Jonas produces the java stubs, the
whole web application as a
> war with a limited wsdd descriptor. At
deployment time, Jonas merges the
> war's wsdd file with the full
platform's one to expose the web service
> endpoint. This is the wsdd
file :
 Presumably the following is happening: At
> assembly time Jonas uses
wsdl2java to generate, among other things, a
> deploy.wsdd. At deployment
time, Jonas uses the Axis AdminClient to merge
> this deploy.wsdd into
Axis' server-config.wsdd. Do you know if this is
> correct?

 
> <?xml version="1.0" encoding="UTF-8"?>
<deployment
> xmlns="http://xml.apache.org/axis/wsdd/"
 [snip]
 
> </deployment>
 There are no operation elements in that WSDD. Without them,
> Axis won't
use the names and types you intended in the input and output
> messages.

 
> From my point of view, Axis was expected to use the given wsdl file
to
> handle client requests according to the descriptor it generated
itself...
> Well, Axis (at least as of 1.2RC) does that. Not directly, though. You
need
> to process your WSDL with wsdl2java and among other things, you
get a
> deploy.wsdd with names, types and namespaces specified for
operations. Also,
> the deployScope can be specified.

I may be mistaken and I can't claim that
> Axis is doing
everything right,
but the problem in your case appears to be
> one of integration where the
Jonas installation doesn't make full use of
> what Axis offers. I don't
know Jonas, thus I can't say whether this is a
> genuine limitation of
the respective Jonas version or a shortcoming of the
> deployment.

Michael

--
Michael Schuerig Contests between male toads over
> females are
mailto:michael@schuerig.de often settled by the depth of the
> croak.
http://www.schuerig.de/michael/ --John Maynard Smith

RE: Document/Literal : bad part name in axis server response

Posted by Ephemeris Lappis <ep...@tiscali.fr>.
I don't know if Jonas uses all axis tools options to generate what it needs
to deploy the ws endpoints. I will ask it to the Jonas team. If i had time,
i should also build a simple test ou of Jonas to evaluate the axis behaviour
without Jonas. But, for the moment, time is precisely what i have not !...
On the other hand, someone (Anne Thomas Manes, i think) has posted few days
ago some lines of axis code where the return name is hard coded, and thus
doesn't take into account neither the wsdl descriptor nor the wsdd file... I
think i will wait for the axis team to give their opinion about all that...
if they do it !

Thanks anyway...

>>> -----Message d'origine-----
>>> De : Michael Schuerig [mailto:michael@schuerig.de]
>>> Envoyé : mardi 11 janvier 2005 11:51
>>> À : axis-user@ws.apache.org
>>> Objet : Re: Document/Literal : bad part name in axis server response
>>>
>>>
>>> On Tuesday 11 January 2005 07:26, Ephemeris Lappis wrote:
>>> > I don't use wsdl2java.
>>>
>>> I had it the wrong way around and confused the java2wsdl from your
>>> original message with wsdl2java.
>>>
>>> > In Jonas, using the new (not so new) ejb 2.1 service endpoint
>>> > features, i just provide the wsdl (that is generated from the java
>>> > endpoint interface), and the ejb and webservices descriptors (for the
>>> > ejb deployment). At assembly time, Jonas produces the java stubs, the
>>> > whole web application as a war with a limited wsdd descriptor. At
>>> > deployment time, Jonas merges the war's wsdd file with the full
>>> > platform's one to expose the web service endpoint. This is the wsdd
>>> > file :
>>>
>>> Presumably the following is happening: At assembly time Jonas uses
>>> wsdl2java to generate, among other things, a deploy.wsdd. At deployment
>>> time, Jonas uses the Axis AdminClient to merge this deploy.wsdd into
>>> Axis' server-config.wsdd. Do you know if this is correct?
>>>
>>> > <?xml version="1.0" encoding="UTF-8"?>
>>> > <deployment xmlns="http://xml.apache.org/axis/wsdd/"
>>> [snip]
>>> > </deployment>
>>>
>>> There are no operation elements in that WSDD. Without them, Axis won't
>>> use the names and types you intended in the input and output messages.
>>>
>>> > From my point of view, Axis was expected to use the given wsdl file
>>> > to handle client requests according to the descriptor it generated
>>> > itself...
>>>
>>> Well, Axis (at least as of 1.2RC) does that. Not directly, though. You
>>> need to process your WSDL with wsdl2java and among other things, you
>>> get a deploy.wsdd with names, types and namespaces specified for
>>> operations. Also, the deployScope can be specified.
>>>
>>> I may be mistaken and I can't claim that Axis is doing
>>> everything right,
>>> but the problem in your case appears to be one of integration where the
>>> Jonas installation doesn't make full use of what Axis offers. I don't
>>> know Jonas, thus I can't say whether this is a genuine limitation of
>>> the respective Jonas version or a shortcoming of the deployment.
>>>
>>> Michael
>>>
>>> --
>>> Michael Schuerig           Contests between male toads over females are
>>> mailto:michael@schuerig.de     often settled by the depth of the croak.
>>> http://www.schuerig.de/michael/                    --John Maynard Smith


Re: Document/Literal : bad part name in axis server response

Posted by Michael Schuerig <mi...@schuerig.de>.
On Tuesday 11 January 2005 07:26, Ephemeris Lappis wrote:
> I don't use wsdl2java.

I had it the wrong way around and confused the java2wsdl from your 
original message with wsdl2java.

> In Jonas, using the new (not so new) ejb 2.1 service endpoint
> features, i just provide the wsdl (that is generated from the java
> endpoint interface), and the ejb and webservices descriptors (for the
> ejb deployment). At assembly time, Jonas produces the java stubs, the
> whole web application as a war with a limited wsdd descriptor. At
> deployment time, Jonas merges the war's wsdd file with the full
> platform's one to expose the web service endpoint. This is the wsdd
> file :

Presumably the following is happening: At assembly time Jonas uses 
wsdl2java to generate, among other things, a deploy.wsdd. At deployment 
time, Jonas uses the Axis AdminClient to merge this deploy.wsdd into 
Axis' server-config.wsdd. Do you know if this is correct?

> <?xml version="1.0" encoding="UTF-8"?>
> <deployment xmlns="http://xml.apache.org/axis/wsdd/"
[snip]
> </deployment>

There are no operation elements in that WSDD. Without them, Axis won't 
use the names and types you intended in the input and output messages.

> From my point of view, Axis was expected to use the given wsdl file
> to handle client requests according to the descriptor it generated
> itself...

Well, Axis (at least as of 1.2RC) does that. Not directly, though. You 
need to process your WSDL with wsdl2java and among other things, you 
get a deploy.wsdd with names, types and namespaces specified for 
operations. Also, the deployScope can be specified.

I may be mistaken and I can't claim that Axis is doing everything right, 
but the problem in your case appears to be one of integration where the 
Jonas installation doesn't make full use of what Axis offers. I don't 
know Jonas, thus I can't say whether this is a genuine limitation of 
the respective Jonas version or a shortcoming of the deployment.

Michael

-- 
Michael Schuerig           Contests between male toads over females are
mailto:michael@schuerig.de     often settled by the depth of the croak.
http://www.schuerig.de/michael/                    --John Maynard Smith

RE: Document/Literal : bad part name in axis server response

Posted by Ephemeris Lappis <ep...@tiscali.fr>.
I don't use wsdl2java.
In Jonas, using the new (not so new) ejb 2.1 service endpoint features, i
just provide the wsdl (that is generated from the java endpoint interface),
and the ejb and webservices descriptors (for the ejb deployment). At
assembly time, Jonas produces the java stubs, the whole web application as a
war with a limited wsdd descriptor. At deployment time, Jonas merges the
war's wsdd file with the full platform's one to expose the web service
endpoint. This is the wsdd file :

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

      <service name="J2ME05WS" provider="java:JOnASEJB"
	           style="document" use="literal" >
        <wsdlFile>j2me05ws.wsdl</wsdlFile>
        <!-- Namespace -->
        <namespace>http://ws.moon.net/j2me05</namespace>
        <!-- Default value for scope -->
        <parameter  name="scope" value="session"/>
        <parameter  name="serviceEndpointJndiName"
                    value="ejb/j2me05/StringToolWebService_SE"/>
		<parameter 	name="serviceEndpointInterfaceName"
		    		value="net.moon.me.five.ws.StringTool"/>
		<parameter  name="allowedMethods"
                    value="reverse"/>

		<handlerInfoChain>
		</handlerInfoChain>
    </service>


</deployment>

The only thing i don't like in this file is the session scope that leads to
creation of useless session when clientsdon't handles cookies. I have
already open a issue report in Jonas bugs lists to ask for a way to select
this scope or, at least, set it up with a default request value...

>From my point of view, Axis was expected to use the given wsdl file to
handle client requests according to the descriptor it generated itself...

>>> -----Message d'origine-----
>>> De : Michael Schuerig [mailto:michael@schuerig.de]
>>> Envoyé : mardi 11 janvier 2005 04:03
>>> À : axis-user@ws.apache.org
>>> Objet : Re: Document/Literal : bad part name in axis server response
>>>
>>>
>>> On Tuesday 11 January 2005 01:57, Bill Keese wrote:
>>>
>>> >  Since all the method request/response info is in the WSDL file, I
>>> > thought you shouldn't need to duplicate any of that information in
>>> > the WSDD file.  You would simply have the WSDD file point to the WSDL
>>> > file.
>>>
>>> Does Axis even use the WSD_L_ file on the server side? I don't
>>> think so.
>>> AFAIR, the wsdlURL parameter in the WSDD file is only used to return
>>> the specified file for ?wsdl-style requests.
>>>
>>> Ephemeris, could you post the WSDD that wsdl2java generates for your
>>> wsdl?
>>>
>>> Michael
>>>
>>> --
>>> Michael Schuerig           Contests between male toads over females are
>>> mailto:michael@schuerig.de     often settled by the depth of the croak.
>>> http://www.schuerig.de/michael/                    --John Maynard Smith


Re: Document/Literal : bad part name in axis server response

Posted by Michael Schuerig <mi...@schuerig.de>.
On Tuesday 11 January 2005 01:57, Bill Keese wrote:

>  Since all the method request/response info is in the WSDL file, I
> thought you shouldn't need to duplicate any of that information in
> the WSDD file.  You would simply have the WSDD file point to the WSDL
> file.

Does Axis even use the WSD_L_ file on the server side? I don't think so. 
AFAIR, the wsdlURL parameter in the WSDD file is only used to return 
the specified file for ?wsdl-style requests.

Ephemeris, could you post the WSDD that wsdl2java generates for your 
wsdl?

Michael

-- 
Michael Schuerig           Contests between male toads over females are
mailto:michael@schuerig.de     often settled by the depth of the croak.
http://www.schuerig.de/michael/                    --John Maynard Smith

RE: Document/Literal : bad part name in axis server response

Posted by Ephemeris Lappis <ep...@tiscali.fr>.
I do agree !!!

>>> -----Message d'origine-----
>>> De : Anne Thomas Manes [mailto:atmanes@gmail.com]
>>> Envoyé : vendredi 7 janvier 2005 18:31
>>> À : axis-user@ws.apache.org
>>> Objet : Re: Document/Literal : bad part name in axis server response
>>>
>>>
>>> Even though there is a work-around, this is still a bug. When using
>>> document/literal, Axis must generate a response message according to
>>> the structure defined in the schema in the WSDL. It should generate
>>> its own function return value only when using RPC style.
>>>
>>> - Anne
>>>
>>> On Fri, 07 Jan 2005 17:34:59 +0900, Bill Keese
>>> <bi...@tech.beacon-it.co.jp> wrote:
>>> > Ah, I see.  Yes, you should be able to use document style or
>>> wrapped style,
>>> > and in document style you don't put the action name inside
>>> the soapBody.
>>> >
>>> > I just looked at the AXIS code that serializes the response
>>> > (Emitter.getResponseMessage()).  It seems like, regardless of
>>> the WSDL file,
>>> > AXIS serializes your function return value as
>>> >    <XXXReturn>
>>> >        12345
>>> >    </XXXReturn>
>>> >
>>> > where 12345 is the return value, and XXX is supposed to be
>>> the operation
>>> > name  (see the code "retName = oper.getName() + "Return";").
>>> Although in
>>> > your case, it's getting confused about what the operation
>>> name is.  However,
>>> > you can override the name of that tag by writing the return
>>> information into
>>> > the WSDD file.  Something like this:
>>> >
>>> >         <operation name="reverse" qname="operNS:reverse"
>>> >                  xmlns:operNS="http://ws.moon.net/j2me05"
>>> >                  returnQName="retNS:reverseResult"
>>> >                  xmlns:retNS="http://ws.moon.net/j2me05"
>>> >                  returnType="rtns:string"
>>> >                  xmlns:rtns="http://www.w3.org/2001/XMLSchema" >
>>> >         <parameter qname="pns:in0"
>>> xmlns:pns="http://ws.moon.net/j2me05"
>>> >                    type="tns:string"
>>> > xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
>>> >       </operation>
>>> >
>>> > According to my reading of Emitter.getResponseMessage() that
>>> should let you
>>> > control the name of the tag immediately below <soap:Body>.
>>> Does that work?
>>> >
>>> > Bill
>>> >
>>> >
>>> > Ephemeris Lappis wrote:
>>> > Hello.
>>> I don't think the problem comes from the request format. First,
>>> > similar
>>> examples, all in document/literal style works fine with the same
>>> > client
>>> (Wireless Toolkit) running against the SUN's JWSDK server. Then, i
>>> > suppose
>>> that if the requests were not correct, the axis server should
>>> > respond with a
>>> fault, and not serve them with an invalid response. Although
>>> > i'm not an
>>> expert, i think the form you give is like a 'wrapped' style
>>> > request while
>>> i'm trying to use the 'document' style...
>>> I've tried the two
>>> > forms (original and the one you suggested) with a simple
>>> HttpURLConnection,
>>> > and wile the first one always produce the successful
>>> invalid response, the
>>> > modified one ends with an axis server fault response.
>>> See bellow the test
>>> > code...
>>> I'd really like an answer to my bug report from the axis
>>> > team...
>>> Thanks anyway...
>>>
>>> package my.tests;
>>>
>>> import
>>> > java.io.BufferedReader;
>>> import java.io.InputStreamReader;
>>> import
>>> > java.io.PrintStream;
>>> import java.net.HttpURLConnection;
>>> import
>>> > java.net.URL;
>>>
>>> public class Test1 {
>>>
>>>  public static void main(final String[]
>>> > args) throws Exception {
>>>
>>>  StringBuffer sb = new StringBuffer();
>>> > sb.append("<?xml version=\"1.0\"
>>> encoding=\"utf-8\"?>").append("\r\n");
>>> > sb.append("<soap:Envelope
>>> xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"").append
>>> ("\r\n");
>>>
>>> sb.append("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"").appe
>>> nd("\r\n");
>>>
>>> sb.append("xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope
>>> /\"").append
>>> ("\r\n");
>>> > sb.append("xmlns:tns=\"http://ws.moon.net/j2me05\">").append("\r\n");
>>> > sb.append("<soap:Body>").append("\r\n");
>>> > sb.append("<tns:in0>ABC</tns:in0>").append("\r\n");
>>> > sb.append("</soap:Body>").append("\r\n");
>>>  sb.append("</soap:Envelope>");
>>> > call(sb);
>>>
>>>  sb = new StringBuffer();
>>>  sb.append("<?xml version=\"1.0\"
>>> > encoding=\"utf-8\"?>").append("\r\n");
>>> > sb.append("<soap:Envelope
>>> xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"").append
>>> ("\r\n");
>>>
>>> sb.append("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"").appe
>>> nd("\r\n");
>>>
>>> sb.append("xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope
>>> /\"").append
>>> ("\r\n");
>>> > sb.append("xmlns:tns=\"http://ws.moon.net/j2me05\">").append("\r\n");
>>> > sb.append("<soap:Body>").append("\r\n");
>>> > sb.append("<tns:reverse>").append("\r\n");
>>> > sb.append("<tns:in0>ABC</tns:in0>").append("\r\n");
>>> > sb.append("</tns:reverse>").append("\r\n");
>>> > sb.append("</soap:Body>").append("\r\n");
>>>  sb.append("</soap:Envelope>");
>>> > call(sb);
>>>
>>>  }
>>>
>>>  static void call(final StringBuffer sb) throws Exception {
>>>
>>> > URL url =
>>> > new
>>> URL("http://localhost:9999/j2me05ws-ejb/J2ME-05-WS/J2ME05WS");
>>> > HttpURLConnection http = (HttpURLConnection) url.openConnection();
>>> > http.setRequestMethod("POST");
>>>  http.setDoOutput(true);
>>> > http.setRequestProperty("Content-Type", "text/xml");
>>> > http.setRequestProperty("Content-Length",
>>> String.valueOf(sb.length()));
>>> > http.setRequestProperty("SOAPAction", "");
>>>  PrintStream ps = new
>>> > PrintStream(http.getOutputStream());
>>>  ps.print(sb);
>>>  ps.flush();
>>>
>>> > BufferedReader reader = new
>>> > BufferedReader(new
>>> InputStreamReader(http.getInputStream()));
>>>  for (;;) {
>>> > String line = reader.readLine();
>>>  if (line == null)
>>>  break;
>>> > System.out.println(line);
>>>  }
>>>
>>>  http.disconnect();
>>>
>>>  }
>>>
>>> }
>>>
>>>
>>>
>>>
>>>
>>> > -----Message d'origine-----
>>> De : Bill Keese
>>> > [mailto:billk@tech.beacon-it.co.jp]
>>> Envoyé : vendredi 7 janvier 2005 02:39
>>> À
>>> > : axis-user@ws.apache.org
>>> Objet : Re: Document/Literal : bad part name in
>>> > axis server response
>>>
>>>
>>> OK. I looked over your mail again and I saw a
>>> > problem. You are using
>>> document/literal, right? For the request, you should
>>> > have the name of
>>> the method within your soap body. And for the response, I'm
>>> > not sure
>>> what is correct but I listed my hypothesis below. (I'm still
>>> > figuring
>>> it out myself)
>>>
>>> Here's the current request:
>>>
>>>
>>> >  <soap:Body>
>>>  <tns:in0>ABC</tns:in0>
>>>  </soap:Body>
>>>  </soap:Envelope>
>>>
>>>  You
>>> > are calling the method "reverse" with the parameter "in0",
>>> right? I
>>> think
>>> > the SOAP body should be:
>>>
>>> <soap:Body>
>>>  <reverse>
>>>  <in0>ABC</in0>
>>> > </reverse>
>>> </soap:Body>
>>>
>>> (I'm not sure about the namespaces though)
>>>
>>> Here's
>>> > the current response
>>>
>>>
>>> >  <soapenv:Body>
>>>  <in0Return
>>> > xmlns="http://ws.moon.net/j2me05">CBA</in0Return>
>>> > </soapenv:Body></soapenv:Envelope>
>>>
>>>  It thinks that in0 is the name of your
>>> > method, rather than the name of
>>> the parameter to the method.
>>>
>>> To setup the
>>> > request, you need a schema type with the same name as your
>>> method:
>>>
>>> <schema
>>> > xmlns="http://www.w3.org/2001/XMLSchema"
>>> targetNamespace="http://ws.moon.net/j2me05"
>>> elementFormDefault="qualified">
>>> > <complexType name="reverse">
>>>  <element name="in0" type="xsd:string"/>
>>> > </complexType>
>>> </schema>
>>>
>>> Then you setup a message that just points to the
>>> > schema type
>>> (it's useless but you have to put it in because that's the
>>> > way
>>> WSDL works):
>>>
>>> <wsdl:message name="reverseRequest">
>>>  <wsdl:part
>>> > name="parameters" element="impl:reverse"/>
>>> </wsdl:message>
>>>
>>>
>>> I'm not sure
>>> > how to setup the WSDL with regard to responses.
>>> If you look at
>>> > http://www.n2soft.net/Services/HNDCAP.asmx?wsdl
>>> (or other links from
>>> > www.mindreef.com), you will see this:
>>>
>>> <s:element name="PostScoreResponse">
>>> > <s:complexType>
>>>  <s:sequence>
>>>  <s:element minOccurs="1"
>>> > maxOccurs="1"
>>> name="PostScoreResult" type="s:boolean"/>
>>>  </s:sequence>
>>> > </s:complexType>
>>> </s:element>
>>>
>>> <wsdl:message name="PostScoreSoapOut">
>>> > <wsdl:part name="parameters"
>>> > element="tns:PostScoreResponse"/>
>>> </wsdl:message>
>>>
>>> (Again, the message just
>>> > points to the schema definition, where
>>> the element name is methodName +
>>> > "Response".
>>> I guess that this would produce a response like
>>>
>>> <soap:Body>
>>> > <PostScoreResponse>
>>>  <PostScoreResult>42</PostScoreResult>
>>> > </PostScoreResponse>
>>> </soap:Body>
>>>
>>> It seems like a lot of overhead for one
>>> > number but I've got a
>>> feeling that the clients won't work unless you
>>> > structure it
>>> like that. I'm still experimenting though.
>>>
>>>
>>> Bill
>>>
>>> Ephemeris
>>> > Lappis wrote:
>>>
>>>
>>> > Before i open a bug, i'd like to have the opinion of experts !
>>> All my last
>>> > tests around document/literal style let me with
>>>  troubles. To
>>>
>>> > start again with simple things, i have made a basic service to
>>>  evaluate
>>> > the
>>>
>>> > primary interoperability with my J2ME client. This simple
>>>  service provides
>>> > a
>>>
>>> > single operation that takes a string, reverses it and return it.
>>> On the
>>> > client side, i work with the SUN Wireless toolkit that
>>>  support the
>>>
>>> > JSR172 (web-service for J2ME). Using the axis wsdl i have
>>> > successfully
>>> generated the j2me client stubs, and built my midlet to call
>>> > the web
>>> service. At run time, the client reports an error in the
>>>  server
>>> > response :
>>>
>>> > the name of the response part for the return value is not as
>>>  defined in
>>> > the
>>>
>>> > wsdl descriptor. To be sure, i had made the test again putting the
>>> > tcp
>>> monitor in the middle... and it seems the client is right !
>>> The name of
>>> > the part in the wsdl is 'reverseReturn' and axis uses
>>> 'in0Return'...
>>> Is it a
>>> > bug, or just another mis-interpretation of mine ?
>>> Thanks to give your
>>> > opinion before i open an unnecessary bug report...
>>>
>>>
>>> Here the java code
>>> > :
>>>
>>> --- java interface ---
>>> package net.moon.me.five.ws;
>>>
>>> import
>>> > java.rmi.Remote;
>>> import java.rmi.RemoteException;
>>>
>>> public interface
>>> > StringTool extends Remote {
>>>
>>>  public String reverse(String string) throws
>>> > RemoteException;
>>>
>>> }
>>> ----------------------
>>>
>>> I have successfully generated
>>> > the wsdl with the following ant script :
>>>
>>> --- wsdl2java ant script
>>> > ---
>>> <property name="my.namespace" value="http://ws.moon.net/j2me05"
>>> > />
>>> <java2wsdl output="./wsdl/j2me05ws.wsdl"
>>> > className="net.moon.me.five.ws.StringTool"
>>>  namespace="${my.namespace}"
>>> > porttypename="StringUtility"
>>>  serviceportname="StringUtilityPort"
>>> > serviceelementname="J2ME05"
>>>  style="DOCUMENT"
>>> > location="http://ws.moon.net/j2me05">
>>>  <classpath>
>>>  <pathelement
>>> > location="${my.services.compile-directory}" />
>>>  <path
>>> > refid="my.axis.classpath" />
>>> > </classpath>
>>> </java2wsdl>
>>> ----------------------------
>>>
>>> The resulting WSDL,
>>> > with the expected part names !
>>>
>>> --- WSDL ---
>>> <?xml version="1.0"
>>> > encoding="UTF-8"?>
>>> <wsdl:definitions
>>> > targetNamespace="http://ws.moon.net/j2me05"
>>> xmlns:impl="http://ws.moon.net/j2me05"
>>> xmlns:intf="http://ws.moon.net/j2me05"
>>> xmlns:apachesoap="http://xml.apache.org/xml-soap"
>>> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
>>> <!--WSDL
>>> > created by Apache Axis version: 1.2RC2
>>> Built on Nov 16, 2004 (12:19:44
>>> > EST)-->
>>> <wsdl:types>
>>>  <schema
>>> > xmlns="http://www.w3.org/2001/XMLSchema"
>>> targetNamespace="http://ws.moon.net/j2me05"
>>> > elementFormDefault="qualified">
>>>
>>> >  <element name="in0" type="xsd:string"/>
>>>  <element name="reverseReturn"
>>> > type="xsd:string"/>
>>>  </schema>
>>> </wsdl:types>
>>>
>>>  <wsdl:message
>>> > name="reverseRequest">
>>>
>>>  <wsdl:part name="in0" element="impl:in0"/>
>>>
>>> > </wsdl:message>
>>>
>>>  <wsdl:message name="reverseResponse">
>>>
>>>  <wsdl:part
>>> > name="reverseReturn" element="impl:reverseReturn"/>
>>>
>>>  </wsdl:message>
>>>
>>> > <wsdl:portType name="StringUtility">
>>>
>>>  <wsdl:operation name="reverse"
>>> > parameterOrder="in0">
>>>
>>>  <wsdl:input name="reverseRequest"
>>> > message="impl:reverseRequest"/>
>>>
>>> >  <wsdl:output name="reverseResponse"
>>> message="impl:reverseResponse"/>
>>>
>>> > </wsdl:operation>
>>>
>>>  </wsdl:portType>
>>>
>>>  <wsdl:binding
>>> > name="StringUtilityPortSoapBinding"
>>> type="impl:StringUtility">
>>>
>>> > <wsdlsoap:binding
>>> > style="document"
>>> transport="http://schemas.xmlsoap.org/soap/http"/>
>>>
>>> > <wsdl:operation name="reverse">
>>>
>>>  <wsdlsoap:operation soapAction=""/>
>>>
>>> > <wsdl:input name="reverseRequest">
>>>
>>>  <wsdlsoap:body use="literal"/>
>>>
>>> > </wsdl:input>
>>>
>>>  <wsdl:output name="reverseResponse">
>>>
>>>  <wsdlsoap:body
>>> > use="literal"/>
>>>
>>>  </wsdl:output>
>>>
>>>  </wsdl:operation>
>>>
>>>  </wsdl:binding>
>>>
>>> > <wsdl:service name="J2ME05">
>>>
>>>  <wsdl:port
>>> > name="StringUtilityPort"
>>> binding="impl:StringUtilityPortSoapBinding">
>>>
>>> > <wsdlsoap:address location="http://ws.moon.net/j2me05"/>
>>>
>>>  </wsdl:port>
>>>
>>> > </wsdl:service>
>>>
>>> </wsdl:definitions>
>>> -------------------------------------
>>>
>>> And
>>> > now, the dumped http request and response :
>>>
>>> --- request ---
>>> POST
>>> > /j2me05ws-ejb/J2ME-05-WS/J2ME05WS HTTP/1.1
>>> User-Agent: Profile/MIDP-1.0
>>> > Configuration/CLDC-1.0
>>> Content-Language: en-US
>>> Content-Type:
>>> > text/xml
>>> SOAPAction: "
>>> Content-Length: 315
>>> Host: localhost
>>>
>>> <?xml
>>> > version="1.0" encoding="utf-8"?>
>>>  <soap:Envelope
>>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>>> xmlns:tns="http://ws.moon.net/j2me05">
>>> > <soap:Body>
>>>  <tns:in0>ABC</tns:in0>
>>>  </soap:Body>
>>> > </soap:Envelope>
>>> ---------------
>>>
>>> --- response ---
>>> HTTP/1.1 200
>>> > OK
>>> Set-Cookie: JSESSIONID=75C329A6CED0EE74D896E083043AFA0A;
>>> > Path=/j2me05ws-ejb
>>>
>>> > Content-Type: text/xml;charset=utf-8
>>> Transfer-Encoding: chunked
>>> Date: Tue,
>>> > 21 Dec 2004 14:15:18 GMT
>>> Server: Apache-Coyote/1.1
>>>
>>> 123
>>> <soapenv:Envelope
>>> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>>
>>> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>>> > <soapenv:Body>
>>>  <in0Return
>>> > xmlns="http://ws.moon.net/j2me05">CBA</in0Return>
>>> > </soapenv:Body></soapenv:Envelope>
>>> 0
>>> ----------------


Re: Document/Literal : bad part name in axis server response

Posted by Anne Thomas Manes <at...@gmail.com>.
Even though there is a work-around, this is still a bug. When using
document/literal, Axis must generate a response message according to
the structure defined in the schema in the WSDL. It should generate
its own function return value only when using RPC style.

- Anne

On Fri, 07 Jan 2005 17:34:59 +0900, Bill Keese
<bi...@tech.beacon-it.co.jp> wrote:
> Ah, I see.  Yes, you should be able to use document style or wrapped style,
> and in document style you don't put the action name inside the soapBody.
> 
> I just looked at the AXIS code that serializes the response
> (Emitter.getResponseMessage()).  It seems like, regardless of the WSDL file,
> AXIS serializes your function return value as
>    <XXXReturn>
>        12345
>    </XXXReturn>
> 
> where 12345 is the return value, and XXX is supposed to be the operation
> name  (see the code "retName = oper.getName() + "Return";").  Although in
> your case, it's getting confused about what the operation name is.  However,
> you can override the name of that tag by writing the return information into
> the WSDD file.  Something like this:
> 
>         <operation name="reverse" qname="operNS:reverse" 
>                  xmlns:operNS="http://ws.moon.net/j2me05" 
>                  returnQName="retNS:reverseResult" 
>                  xmlns:retNS="http://ws.moon.net/j2me05" 
>                  returnType="rtns:string" 
>                  xmlns:rtns="http://www.w3.org/2001/XMLSchema" >
>         <parameter qname="pns:in0" xmlns:pns="http://ws.moon.net/j2me05" 
>                    type="tns:string"
> xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
>       </operation>
> 
> According to my reading of Emitter.getResponseMessage() that should let you
> control the name of the tag immediately below <soap:Body>.   Does that work?
> 
> Bill
> 
> 
> Ephemeris Lappis wrote: 
> Hello.
I don't think the problem comes from the request format. First,
> similar
examples, all in document/literal style works fine with the same
> client
(Wireless Toolkit) running against the SUN's JWSDK server. Then, i
> suppose
that if the requests were not correct, the axis server should
> respond with a
fault, and not serve them with an invalid response. Although
> i'm not an
expert, i think the form you give is like a 'wrapped' style
> request while
i'm trying to use the 'document' style...
I've tried the two
> forms (original and the one you suggested) with a simple
HttpURLConnection,
> and wile the first one always produce the successful
invalid response, the
> modified one ends with an axis server fault response.
See bellow the test
> code...
I'd really like an answer to my bug report from the axis
> team...
Thanks anyway...

package my.tests;

import
> java.io.BufferedReader;
import java.io.InputStreamReader;
import
> java.io.PrintStream;
import java.net.HttpURLConnection;
import
> java.net.URL;

public class Test1 {

 public static void main(final String[]
> args) throws Exception {

 StringBuffer sb = new StringBuffer();
> sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>").append("\r\n");
> sb.append("<soap:Envelope
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"").append("\r\n");

sb.append("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"").append("\r\n");

sb.append("xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"").append
("\r\n");
> sb.append("xmlns:tns=\"http://ws.moon.net/j2me05\">").append("\r\n");
> sb.append("<soap:Body>").append("\r\n");
> sb.append("<tns:in0>ABC</tns:in0>").append("\r\n");
> sb.append("</soap:Body>").append("\r\n");
 sb.append("</soap:Envelope>");
> call(sb);

 sb = new StringBuffer();
 sb.append("<?xml version=\"1.0\"
> encoding=\"utf-8\"?>").append("\r\n");
> sb.append("<soap:Envelope
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"").append("\r\n");

sb.append("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"").append("\r\n");

sb.append("xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"").append
("\r\n");
> sb.append("xmlns:tns=\"http://ws.moon.net/j2me05\">").append("\r\n");
> sb.append("<soap:Body>").append("\r\n");
> sb.append("<tns:reverse>").append("\r\n");
> sb.append("<tns:in0>ABC</tns:in0>").append("\r\n");
> sb.append("</tns:reverse>").append("\r\n");
> sb.append("</soap:Body>").append("\r\n");
 sb.append("</soap:Envelope>");
> call(sb);

 }

 static void call(final StringBuffer sb) throws Exception {

> URL url =
> new
URL("http://localhost:9999/j2me05ws-ejb/J2ME-05-WS/J2ME05WS");
> HttpURLConnection http = (HttpURLConnection) url.openConnection();
> http.setRequestMethod("POST");
 http.setDoOutput(true);
> http.setRequestProperty("Content-Type", "text/xml");
> http.setRequestProperty("Content-Length", String.valueOf(sb.length()));
> http.setRequestProperty("SOAPAction", "");
 PrintStream ps = new
> PrintStream(http.getOutputStream());
 ps.print(sb);
 ps.flush();

> BufferedReader reader = new
> BufferedReader(new
InputStreamReader(http.getInputStream()));
 for (;;) {
> String line = reader.readLine();
 if (line == null)
 break;
> System.out.println(line);
 }

 http.disconnect();

 }

}




 
> -----Message d'origine-----
De : Bill Keese
> [mailto:billk@tech.beacon-it.co.jp]
Envoyé : vendredi 7 janvier 2005 02:39
À
> : axis-user@ws.apache.org
Objet : Re: Document/Literal : bad part name in
> axis server response


OK. I looked over your mail again and I saw a
> problem. You are using
document/literal, right? For the request, you should
> have the name of
the method within your soap body. And for the response, I'm
> not sure
what is correct but I listed my hypothesis below. (I'm still
> figuring
it out myself)

Here's the current request:

 
>  <soap:Body>
 <tns:in0>ABC</tns:in0>
 </soap:Body>
 </soap:Envelope>

 You
> are calling the method "reverse" with the parameter "in0",
right? I
think
> the SOAP body should be:

<soap:Body>
 <reverse>
 <in0>ABC</in0>
> </reverse>
</soap:Body>

(I'm not sure about the namespaces though)

Here's
> the current response

 
>  <soapenv:Body>
 <in0Return
> xmlns="http://ws.moon.net/j2me05">CBA</in0Return>
> </soapenv:Body></soapenv:Envelope>

 It thinks that in0 is the name of your
> method, rather than the name of
the parameter to the method.

To setup the
> request, you need a schema type with the same name as your
method:

<schema
> xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://ws.moon.net/j2me05"
elementFormDefault="qualified">
> <complexType name="reverse">
 <element name="in0" type="xsd:string"/>
> </complexType>
</schema>

Then you setup a message that just points to the
> schema type
(it's useless but you have to put it in because that's the
> way
WSDL works):

<wsdl:message name="reverseRequest">
 <wsdl:part
> name="parameters" element="impl:reverse"/>
</wsdl:message>


I'm not sure
> how to setup the WSDL with regard to responses.
If you look at
> http://www.n2soft.net/Services/HNDCAP.asmx?wsdl
(or other links from
> www.mindreef.com), you will see this:

<s:element name="PostScoreResponse">
> <s:complexType>
 <s:sequence>
 <s:element minOccurs="1"
> maxOccurs="1"
name="PostScoreResult" type="s:boolean"/>
 </s:sequence>
> </s:complexType>
</s:element>

<wsdl:message name="PostScoreSoapOut">
> <wsdl:part name="parameters"
> element="tns:PostScoreResponse"/>
</wsdl:message>

(Again, the message just
> points to the schema definition, where
the element name is methodName +
> "Response".
I guess that this would produce a response like

<soap:Body>
> <PostScoreResponse>
 <PostScoreResult>42</PostScoreResult>
> </PostScoreResponse>
</soap:Body>

It seems like a lot of overhead for one
> number but I've got a
feeling that the clients won't work unless you
> structure it
like that. I'm still experimenting though.


Bill

Ephemeris
> Lappis wrote:

 
> Before i open a bug, i'd like to have the opinion of experts !
All my last
> tests around document/literal style let me with
 troubles. To
 
> start again with simple things, i have made a basic service to
 evaluate
> the
 
> primary interoperability with my J2ME client. This simple
 service provides
> a
 
> single operation that takes a string, reverses it and return it.
On the
> client side, i work with the SUN Wireless toolkit that
 support the
 
> JSR172 (web-service for J2ME). Using the axis wsdl i have
> successfully
generated the j2me client stubs, and built my midlet to call
> the web
service. At run time, the client reports an error in the
 server
> response :
 
> the name of the response part for the return value is not as
 defined in
> the
 
> wsdl descriptor. To be sure, i had made the test again putting the
> tcp
monitor in the middle... and it seems the client is right !
The name of
> the part in the wsdl is 'reverseReturn' and axis uses
'in0Return'...
Is it a
> bug, or just another mis-interpretation of mine ?
Thanks to give your
> opinion before i open an unnecessary bug report...


Here the java code
> :

--- java interface ---
package net.moon.me.five.ws;

import
> java.rmi.Remote;
import java.rmi.RemoteException;

public interface
> StringTool extends Remote {

 public String reverse(String string) throws
> RemoteException;

}
----------------------

I have successfully generated
> the wsdl with the following ant script :

--- wsdl2java ant script
> ---
<property name="my.namespace" value="http://ws.moon.net/j2me05"
> />
<java2wsdl output="./wsdl/j2me05ws.wsdl"
> className="net.moon.me.five.ws.StringTool"
 namespace="${my.namespace}"
> porttypename="StringUtility"
 serviceportname="StringUtilityPort"
> serviceelementname="J2ME05"
 style="DOCUMENT"
> location="http://ws.moon.net/j2me05">
 <classpath>
 <pathelement
> location="${my.services.compile-directory}" />
 <path
> refid="my.axis.classpath" />
> </classpath>
</java2wsdl>
----------------------------

The resulting WSDL,
> with the expected part names !

--- WSDL ---
<?xml version="1.0"
> encoding="UTF-8"?>
<wsdl:definitions
> targetNamespace="http://ws.moon.net/j2me05"
xmlns:impl="http://ws.moon.net/j2me05"
xmlns:intf="http://ws.moon.net/j2me05"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--WSDL
> created by Apache Axis version: 1.2RC2
Built on Nov 16, 2004 (12:19:44
> EST)-->
<wsdl:types>
 <schema
> xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://ws.moon.net/j2me05"
> elementFormDefault="qualified">
 
>  <element name="in0" type="xsd:string"/>
 <element name="reverseReturn"
> type="xsd:string"/>
 </schema>
</wsdl:types>

 <wsdl:message
> name="reverseRequest">

 <wsdl:part name="in0" element="impl:in0"/>

> </wsdl:message>

 <wsdl:message name="reverseResponse">

 <wsdl:part
> name="reverseReturn" element="impl:reverseReturn"/>

 </wsdl:message>

> <wsdl:portType name="StringUtility">

 <wsdl:operation name="reverse"
> parameterOrder="in0">

 <wsdl:input name="reverseRequest"
> message="impl:reverseRequest"/>
 
>  <wsdl:output name="reverseResponse"
message="impl:reverseResponse"/>

> </wsdl:operation>

 </wsdl:portType>

 <wsdl:binding
> name="StringUtilityPortSoapBinding"
type="impl:StringUtility">

> <wsdlsoap:binding
> style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>

> <wsdl:operation name="reverse">

 <wsdlsoap:operation soapAction=""/>

> <wsdl:input name="reverseRequest">

 <wsdlsoap:body use="literal"/>

> </wsdl:input>

 <wsdl:output name="reverseResponse">

 <wsdlsoap:body
> use="literal"/>

 </wsdl:output>

 </wsdl:operation>

 </wsdl:binding>

> <wsdl:service name="J2ME05">

 <wsdl:port
> name="StringUtilityPort"
binding="impl:StringUtilityPortSoapBinding">

> <wsdlsoap:address location="http://ws.moon.net/j2me05"/>

 </wsdl:port>

> </wsdl:service>

</wsdl:definitions>
-------------------------------------

And
> now, the dumped http request and response :

--- request ---
POST
> /j2me05ws-ejb/J2ME-05-WS/J2ME05WS HTTP/1.1
User-Agent: Profile/MIDP-1.0
> Configuration/CLDC-1.0
Content-Language: en-US
Content-Type:
> text/xml
SOAPAction: "
Content-Length: 315
Host: localhost

<?xml
> version="1.0" encoding="utf-8"?>
 <soap:Envelope
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="http://ws.moon.net/j2me05">
> <soap:Body>
 <tns:in0>ABC</tns:in0>
 </soap:Body>
> </soap:Envelope>
---------------

--- response ---
HTTP/1.1 200
> OK
Set-Cookie: JSESSIONID=75C329A6CED0EE74D896E083043AFA0A;
> Path=/j2me05ws-ejb
 
> Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Tue,
> 21 Dec 2004 14:15:18 GMT
Server: Apache-Coyote/1.1

123
<soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <soapenv:Body>
 <in0Return
> xmlns="http://ws.moon.net/j2me05">CBA</in0Return>
> </soapenv:Body></soapenv:Envelope>
0
----------------

RE: Document/Literal : bad part name in axis server response

Posted by Ephemeris Lappis <ep...@tiscali.fr>.
Hello.
I don't think the problem comes from the request format. First, similar
examples, all in document/literal style works fine with the same client
(Wireless Toolkit) running against the SUN's JWSDK server. Then, i suppose
that if the requests were not correct, the axis server should respond with a
fault, and not serve them with an invalid response. Although i'm not an
expert, i think the form you give is like a 'wrapped' style request while
i'm trying to use the 'document' style...
I've tried the two forms (original and the one you suggested) with a simple
HttpURLConnection, and wile the first one always produce the successful
invalid response, the modified one ends with an axis server fault response.
See bellow the test code...
I'd really like an answer to my bug report from the axis team...
Thanks anyway...

package my.tests;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class Test1 {

	public static void main(final String[] args) throws Exception {

		StringBuffer sb = new StringBuffer();
		sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>").append("\r\n");
		sb.append("<soap:Envelope
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"").append("\r\n");

sb.append("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"").append("\r\n");

sb.append("xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"").append
("\r\n");
		sb.append("xmlns:tns=\"http://ws.moon.net/j2me05\">").append("\r\n");
		sb.append("<soap:Body>").append("\r\n");
		sb.append("<tns:in0>ABC</tns:in0>").append("\r\n");
		sb.append("</soap:Body>").append("\r\n");
		sb.append("</soap:Envelope>");
		call(sb);

		sb = new StringBuffer();
		sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>").append("\r\n");
		sb.append("<soap:Envelope
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"").append("\r\n");

sb.append("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"").append("\r\n");

sb.append("xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"").append
("\r\n");
		sb.append("xmlns:tns=\"http://ws.moon.net/j2me05\">").append("\r\n");
		sb.append("<soap:Body>").append("\r\n");
		sb.append("<tns:reverse>").append("\r\n");
		sb.append("<tns:in0>ABC</tns:in0>").append("\r\n");
		sb.append("</tns:reverse>").append("\r\n");
		sb.append("</soap:Body>").append("\r\n");
		sb.append("</soap:Envelope>");
		call(sb);

	}

	static void call(final StringBuffer sb) throws Exception {

		URL url = new
URL("http://localhost:9999/j2me05ws-ejb/J2ME-05-WS/J2ME05WS");
		HttpURLConnection http = (HttpURLConnection) url.openConnection();
		http.setRequestMethod("POST");
		http.setDoOutput(true);
		http.setRequestProperty("Content-Type", "text/xml");
		http.setRequestProperty("Content-Length", String.valueOf(sb.length()));
		http.setRequestProperty("SOAPAction", "");
		PrintStream ps = new PrintStream(http.getOutputStream());
		ps.print(sb);
		ps.flush();

		BufferedReader reader = new BufferedReader(new
InputStreamReader(http.getInputStream()));
		for (;;) {
			String line = reader.readLine();
			if (line == null)
				break;
			System.out.println(line);
		}

		http.disconnect();

	}

}




>>> -----Message d'origine-----
>>> De : Bill Keese [mailto:billk@tech.beacon-it.co.jp]
>>> Envoyé : vendredi 7 janvier 2005 02:39
>>> À : axis-user@ws.apache.org
>>> Objet : Re: Document/Literal : bad part name in axis server response
>>>
>>>
>>> OK.  I looked over your mail again and I saw a problem.  You are using
>>> document/literal, right?  For the request, you should have the name of
>>> the method within your soap body.   And for the response, I'm not sure
>>> what is correct but I listed my hypothesis below.   (I'm still figuring
>>> it out myself)
>>>
>>> Here's the current request:
>>>
>>> >     <soap:Body>
>>> >        <tns:in0>ABC</tns:in0>
>>> >     </soap:Body>
>>> >  </soap:Envelope>
>>> >
>>> You are calling the method "reverse" with the parameter "in0",
>>> right?  I
>>> think the SOAP body should be:
>>>
>>> <soap:Body>
>>>    <reverse>
>>>      <in0>ABC</in0>
>>>   </reverse>
>>> </soap:Body>
>>>
>>> (I'm not sure about the namespaces though)
>>>
>>> Here's the current response
>>>
>>> >>  <soapenv:Body>
>>> >>     <in0Return xmlns="http://ws.moon.net/j2me05">CBA</in0Return>
>>> >>  </soapenv:Body></soapenv:Envelope>
>>> >>
>>> It thinks that in0 is the name of your method, rather than the name of
>>> the parameter to the method.
>>>
>>> To setup the request, you need a schema type with the same name as your
>>> method:
>>>
>>> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>>> targetNamespace="http://ws.moon.net/j2me05"
>>> elementFormDefault="qualified">
>>>   <complexType name="reverse">
>>>       <element name="in0" type="xsd:string"/>
>>>   </complexType>
>>> </schema>
>>>
>>> Then you setup a message that just points to the schema type
>>> (it's useless but you have to put it in because that's the way
>>> WSDL works):
>>>
>>> <wsdl:message name="reverseRequest">
>>>      <wsdl:part name="parameters" element="impl:reverse"/>
>>> </wsdl:message>
>>>
>>>
>>> I'm not sure how to setup the WSDL with regard to responses.
>>> If you look at http://www.n2soft.net/Services/HNDCAP.asmx?wsdl
>>> (or other links from www.mindreef.com),  you will see this:
>>>
>>> <s:element name="PostScoreResponse">
>>>   <s:complexType>
>>>     <s:sequence>
>>>       <s:element minOccurs="1" maxOccurs="1"
>>> name="PostScoreResult" type="s:boolean"/>
>>>     </s:sequence>
>>>   </s:complexType>
>>> </s:element>
>>>
>>> <wsdl:message name="PostScoreSoapOut">
>>>   <wsdl:part name="parameters" element="tns:PostScoreResponse"/>
>>> </wsdl:message>
>>>
>>> (Again, the message just points to the schema definition, where
>>> the element name is methodName + "Response".
>>> I guess that this would produce a response like
>>>
>>> <soap:Body>
>>>    <PostScoreResponse>
>>>       <PostScoreResult>42</PostScoreResult>
>>>    </PostScoreResponse>
>>> </soap:Body>
>>>
>>> It seems like a lot of overhead for one number but I've got a
>>> feeling that the clients won't work unless you structure it
>>> like that.  I'm still experimenting though.
>>>
>>>
>>> Bill
>>>
>>> Ephemeris Lappis wrote:
>>>
>>> >Before i open a bug, i'd like to have the opinion of experts !
>>> >All my last tests around document/literal style let me with
>>> troubles. To
>>> >start again with simple things, i have made a basic service to
>>> evaluate the
>>> >primary interoperability with my J2ME client. This simple
>>> service provides a
>>> >single operation that takes a string, reverses it and return it.
>>> >On the client side, i work with the SUN Wireless toolkit that
>>> support the
>>> >JSR172 (web-service for J2ME). Using the axis wsdl i have successfully
>>> >generated the j2me client stubs, and built my midlet to call the web
>>> >service. At run time, the client reports an error in the
>>> server response :
>>> >the name of the response part for the return value is not as
>>> defined in the
>>> >wsdl descriptor. To be sure, i had made the test again putting the tcp
>>> >monitor in the middle... and it seems the client is right !
>>> >The name of the part in the wsdl is 'reverseReturn' and axis uses
>>> >'in0Return'...
>>> >Is it a bug, or just another mis-interpretation of mine ?
>>> >Thanks to give your opinion before i open an unnecessary bug report...
>>> >
>>> >
>>> >Here the java code :
>>> >
>>> >--- java interface ---
>>> >package net.moon.me.five.ws;
>>> >
>>> >import java.rmi.Remote;
>>> >import java.rmi.RemoteException;
>>> >
>>> >public interface StringTool extends Remote {
>>> >
>>> >	public String reverse(String string) throws RemoteException;
>>> >
>>> >}
>>> >----------------------
>>> >
>>> >I have successfully generated the wsdl with the following ant script :
>>> >
>>> >--- wsdl2java ant script ---
>>> ><property name="my.namespace" value="http://ws.moon.net/j2me05" />
>>> ><java2wsdl output="./wsdl/j2me05ws.wsdl"
>>> >           className="net.moon.me.five.ws.StringTool"
>>> >           namespace="${my.namespace}"
>>> >           porttypename="StringUtility"
>>> >           serviceportname="StringUtilityPort"
>>> >           serviceelementname="J2ME05"
>>> >           style="DOCUMENT"
>>> >           location="http://ws.moon.net/j2me05">
>>> >	<classpath>
>>> >		<pathelement location="${my.services.compile-directory}" />
>>> >		<path refid="my.axis.classpath" />
>>> >	</classpath>
>>> ></java2wsdl>
>>> >----------------------------
>>> >
>>> >The resulting WSDL, with the expected part names !
>>> >
>>> >--- WSDL ---
>>> ><?xml version="1.0" encoding="UTF-8"?>
>>> ><wsdl:definitions targetNamespace="http://ws.moon.net/j2me05"
>>> >xmlns:impl="http://ws.moon.net/j2me05"
>>> >xmlns:intf="http://ws.moon.net/j2me05"
>>> >xmlns:apachesoap="http://xml.apache.org/xml-soap"
>>> >xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>>> >xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> >xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
>>> ><!--WSDL created by Apache Axis version: 1.2RC2
>>> >Built on Nov 16, 2004 (12:19:44 EST)-->
>>> > <wsdl:types>
>>> >  <schema xmlns="http://www.w3.org/2001/XMLSchema"
>>> >targetNamespace="http://ws.moon.net/j2me05"
>>> elementFormDefault="qualified">
>>> >   <element name="in0" type="xsd:string"/>
>>> >   <element name="reverseReturn" type="xsd:string"/>
>>> >  </schema>
>>> > </wsdl:types>
>>> >
>>> >   <wsdl:message name="reverseRequest">
>>> >
>>> >      <wsdl:part name="in0" element="impl:in0"/>
>>> >
>>> >   </wsdl:message>
>>> >
>>> >   <wsdl:message name="reverseResponse">
>>> >
>>> >      <wsdl:part name="reverseReturn" element="impl:reverseReturn"/>
>>> >
>>> >   </wsdl:message>
>>> >
>>> >   <wsdl:portType name="StringUtility">
>>> >
>>> >      <wsdl:operation name="reverse" parameterOrder="in0">
>>> >
>>> >         <wsdl:input name="reverseRequest"
>>> message="impl:reverseRequest"/>
>>> >
>>> >         <wsdl:output name="reverseResponse"
>>> >message="impl:reverseResponse"/>
>>> >
>>> >      </wsdl:operation>
>>> >
>>> >   </wsdl:portType>
>>> >
>>> >   <wsdl:binding name="StringUtilityPortSoapBinding"
>>> >type="impl:StringUtility">
>>> >
>>> >      <wsdlsoap:binding style="document"
>>> >transport="http://schemas.xmlsoap.org/soap/http"/>
>>> >
>>> >      <wsdl:operation name="reverse">
>>> >
>>> >         <wsdlsoap:operation soapAction=""/>
>>> >
>>> >         <wsdl:input name="reverseRequest">
>>> >
>>> >            <wsdlsoap:body use="literal"/>
>>> >
>>> >         </wsdl:input>
>>> >
>>> >         <wsdl:output name="reverseResponse">
>>> >
>>> >            <wsdlsoap:body use="literal"/>
>>> >
>>> >         </wsdl:output>
>>> >
>>> >      </wsdl:operation>
>>> >
>>> >   </wsdl:binding>
>>> >
>>> >   <wsdl:service name="J2ME05">
>>> >
>>> >      <wsdl:port name="StringUtilityPort"
>>> >binding="impl:StringUtilityPortSoapBinding">
>>> >
>>> >         <wsdlsoap:address location="http://ws.moon.net/j2me05"/>
>>> >
>>> >      </wsdl:port>
>>> >
>>> >   </wsdl:service>
>>> >
>>> ></wsdl:definitions>
>>> >-------------------------------------
>>> >
>>> >And now, the dumped http request and response :
>>> >
>>> >--- request ---
>>> >POST /j2me05ws-ejb/J2ME-05-WS/J2ME05WS HTTP/1.1
>>> >User-Agent: Profile/MIDP-1.0 Configuration/CLDC-1.0
>>> >Content-Language: en-US
>>> >Content-Type: text/xml
>>> >SOAPAction: "
>>> >Content-Length: 315
>>> >Host: localhost
>>> >
>>> ><?xml version="1.0" encoding="utf-8"?>
>>> >   <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> >xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> >xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>>> >xmlns:tns="http://ws.moon.net/j2me05">
>>> >      <soap:Body>
>>> >         <tns:in0>ABC</tns:in0>
>>> >      </soap:Body>
>>> >   </soap:Envelope>
>>> >---------------
>>> >
>>> >--- response ---
>>> >HTTP/1.1 200 OK
>>> >Set-Cookie: JSESSIONID=75C329A6CED0EE74D896E083043AFA0A;
>>> Path=/j2me05ws-ejb
>>> >Content-Type: text/xml;charset=utf-8
>>> >Transfer-Encoding: chunked
>>> >Date: Tue, 21 Dec 2004 14:15:18 GMT
>>> >Server: Apache-Coyote/1.1
>>> >
>>> >123
>>> ><soapenv:Envelope
>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>> >xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>>> >   <soapenv:Body>
>>> >      <in0Return xmlns="http://ws.moon.net/j2me05">CBA</in0Return>
>>> >   </soapenv:Body></soapenv:Envelope>
>>> >0
>>> >----------------
>>> >
>>> >
>>> >
>>> >
>>> >


Re: Document/Literal : bad part name in axis server response

Posted by Bill Keese <bi...@tech.beacon-it.co.jp>.
OK.  I looked over your mail again and I saw a problem.  You are using 
document/literal, right?  For the request, you should have the name of 
the method within your soap body.   And for the response, I'm not sure 
what is correct but I listed my hypothesis below.   (I'm still figuring 
it out myself)

Here's the current request:

>     <soap:Body>
>        <tns:in0>ABC</tns:in0>
>     </soap:Body>
>  </soap:Envelope>
>
You are calling the method "reverse" with the parameter "in0", right?  I 
think the SOAP body should be:

<soap:Body>
   <reverse>
     <in0>ABC</in0>
  </reverse>
</soap:Body>

(I'm not sure about the namespaces though)

Here's the current response

>>  <soapenv:Body>
>>     <in0Return xmlns="http://ws.moon.net/j2me05">CBA</in0Return>
>>  </soapenv:Body></soapenv:Envelope>
>>
It thinks that in0 is the name of your method, rather than the name of 
the parameter to the method.

To setup the request, you need a schema type with the same name as your 
method:

<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://ws.moon.net/j2me05" elementFormDefault="qualified">
  <complexType name="reverse">
      <element name="in0" type="xsd:string"/>
  </complexType>
</schema>

Then you setup a message that just points to the schema type (it's useless but you have to put it in because that's the way WSDL works):

<wsdl:message name="reverseRequest">
     <wsdl:part name="parameters" element="impl:reverse"/>
</wsdl:message>


I'm not sure how to setup the WSDL with regard to responses.  If you look at http://www.n2soft.net/Services/HNDCAP.asmx?wsdl (or other links from www.mindreef.com),  you will see this:

<s:element name="PostScoreResponse">
  <s:complexType>
    <s:sequence>
      <s:element minOccurs="1" maxOccurs="1" name="PostScoreResult" type="s:boolean"/>
    </s:sequence>
  </s:complexType>
</s:element>

<wsdl:message name="PostScoreSoapOut">
  <wsdl:part name="parameters" element="tns:PostScoreResponse"/>
</wsdl:message>

(Again, the message just points to the schema definition, where the element name is methodName + "Response".
I guess that this would produce a response like

<soap:Body>
   <PostScoreResponse>
      <PostScoreResult>42</PostScoreResult>
   </PostScoreResponse>
</soap:Body>

It seems like a lot of overhead for one number but I've got a feeling that the clients won't work unless you structure it like that.  I'm still experimenting though.


Bill

Ephemeris Lappis wrote:

>Before i open a bug, i'd like to have the opinion of experts !
>All my last tests around document/literal style let me with troubles. To
>start again with simple things, i have made a basic service to evaluate the
>primary interoperability with my J2ME client. This simple service provides a
>single operation that takes a string, reverses it and return it.
>On the client side, i work with the SUN Wireless toolkit that support the
>JSR172 (web-service for J2ME). Using the axis wsdl i have successfully
>generated the j2me client stubs, and built my midlet to call the web
>service. At run time, the client reports an error in the server response :
>the name of the response part for the return value is not as defined in the
>wsdl descriptor. To be sure, i had made the test again putting the tcp
>monitor in the middle... and it seems the client is right !
>The name of the part in the wsdl is 'reverseReturn' and axis uses
>'in0Return'...
>Is it a bug, or just another mis-interpretation of mine ?
>Thanks to give your opinion before i open an unnecessary bug report...
>
>
>Here the java code :
>
>--- java interface ---
>package net.moon.me.five.ws;
>
>import java.rmi.Remote;
>import java.rmi.RemoteException;
>
>public interface StringTool extends Remote {
>
>	public String reverse(String string) throws RemoteException;
>
>}
>----------------------
>
>I have successfully generated the wsdl with the following ant script :
>
>--- wsdl2java ant script ---
><property name="my.namespace" value="http://ws.moon.net/j2me05" />
><java2wsdl output="./wsdl/j2me05ws.wsdl"
>           className="net.moon.me.five.ws.StringTool"
>           namespace="${my.namespace}"
>           porttypename="StringUtility"
>           serviceportname="StringUtilityPort"
>           serviceelementname="J2ME05"
>           style="DOCUMENT"
>           location="http://ws.moon.net/j2me05">
>	<classpath>
>		<pathelement location="${my.services.compile-directory}" />
>		<path refid="my.axis.classpath" />
>	</classpath>
></java2wsdl>
>----------------------------
>
>The resulting WSDL, with the expected part names !
>
>--- WSDL ---
><?xml version="1.0" encoding="UTF-8"?>
><wsdl:definitions targetNamespace="http://ws.moon.net/j2me05"
>xmlns:impl="http://ws.moon.net/j2me05"
>xmlns:intf="http://ws.moon.net/j2me05"
>xmlns:apachesoap="http://xml.apache.org/xml-soap"
>xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
><!--WSDL created by Apache Axis version: 1.2RC2
>Built on Nov 16, 2004 (12:19:44 EST)-->
> <wsdl:types>
>  <schema xmlns="http://www.w3.org/2001/XMLSchema"
>targetNamespace="http://ws.moon.net/j2me05" elementFormDefault="qualified">
>   <element name="in0" type="xsd:string"/>
>   <element name="reverseReturn" type="xsd:string"/>
>  </schema>
> </wsdl:types>
>
>   <wsdl:message name="reverseRequest">
>
>      <wsdl:part name="in0" element="impl:in0"/>
>
>   </wsdl:message>
>
>   <wsdl:message name="reverseResponse">
>
>      <wsdl:part name="reverseReturn" element="impl:reverseReturn"/>
>
>   </wsdl:message>
>
>   <wsdl:portType name="StringUtility">
>
>      <wsdl:operation name="reverse" parameterOrder="in0">
>
>         <wsdl:input name="reverseRequest" message="impl:reverseRequest"/>
>
>         <wsdl:output name="reverseResponse"
>message="impl:reverseResponse"/>
>
>      </wsdl:operation>
>
>   </wsdl:portType>
>
>   <wsdl:binding name="StringUtilityPortSoapBinding"
>type="impl:StringUtility">
>
>      <wsdlsoap:binding style="document"
>transport="http://schemas.xmlsoap.org/soap/http"/>
>
>      <wsdl:operation name="reverse">
>
>         <wsdlsoap:operation soapAction=""/>
>
>         <wsdl:input name="reverseRequest">
>
>            <wsdlsoap:body use="literal"/>
>
>         </wsdl:input>
>
>         <wsdl:output name="reverseResponse">
>
>            <wsdlsoap:body use="literal"/>
>
>         </wsdl:output>
>
>      </wsdl:operation>
>
>   </wsdl:binding>
>
>   <wsdl:service name="J2ME05">
>
>      <wsdl:port name="StringUtilityPort"
>binding="impl:StringUtilityPortSoapBinding">
>
>         <wsdlsoap:address location="http://ws.moon.net/j2me05"/>
>
>      </wsdl:port>
>
>   </wsdl:service>
>
></wsdl:definitions>
>-------------------------------------
>
>And now, the dumped http request and response :
>
>--- request ---
>POST /j2me05ws-ejb/J2ME-05-WS/J2ME05WS HTTP/1.1
>User-Agent: Profile/MIDP-1.0 Configuration/CLDC-1.0
>Content-Language: en-US
>Content-Type: text/xml
>SOAPAction: "
>Content-Length: 315
>Host: localhost
>
><?xml version="1.0" encoding="utf-8"?>
>   <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>xmlns:tns="http://ws.moon.net/j2me05">
>      <soap:Body>
>         <tns:in0>ABC</tns:in0>
>      </soap:Body>
>   </soap:Envelope>
>---------------
>
>--- response ---
>HTTP/1.1 200 OK
>Set-Cookie: JSESSIONID=75C329A6CED0EE74D896E083043AFA0A; Path=/j2me05ws-ejb
>Content-Type: text/xml;charset=utf-8
>Transfer-Encoding: chunked
>Date: Tue, 21 Dec 2004 14:15:18 GMT
>Server: Apache-Coyote/1.1
>
>123
><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>   <soapenv:Body>
>      <in0Return xmlns="http://ws.moon.net/j2me05">CBA</in0Return>
>   </soapenv:Body></soapenv:Envelope>
>0
>----------------
>
>
>
>  
>