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 Wei Hsu <wh...@openharbor.com> on 2004/04/13 21:11:15 UTC

problem using WSDL2Java on RPC/Literal

Hi all,

 

I've been trying to run WSDL2Java on my RPC/Literal WSDL, but I keep running
into a seemingly simple problem.  In the WSDL, I've created a
createSalesOrderRequest message as the following: 

 

<wsdl:message name="createSalesOrderRequest">

        <wsdl:part name="SalesOrder" type="n1:SalesOrderWrap"/>

</wsdl:message>

 

Here, assume n1 belongs to namespace my.example.com and the namespace of the
WSDL is "urn:SalesCreator".  

 

But when I generate the stubs and make call with them, I found out that the
namespace for SalesOrder isn't picked up.  So the body of the SOAP message
becomes

 

<createSalesOrder xmlns="urn:SalesCreator">

   <SalesOrder xmlns="">

 

Instead of setting the xmlns for SalesOrder to that of SalesOrderWrap or
even that of the WSDL, WSDL2Java sets it to empty the namespace.  Any idea
why that's the case?

 

My question is, is there any thing I can add to the WSDL so that the
generated stubs will set the xmlns to something other than the empty ""?  I
know I can manually modify the stubs to insert a value.  However, that
doesn't solve my problem, since I am writing these WSDL files to be used by
other testing tools that also take advantage of axis' WSDL2Java. 

 

Thanks so much!

 

Wei


Re: problem using WSDL2Java on RPC/Literal

Posted by Ju...@mro.com.




I'm not sure what support Axis has for RPC/Literal (if any), but it seems
to be doing the right thing in this case. By definition, in an RPC/Literal
message, the part names (in your case, SalesOrder) are simply wrappers and
are NOT to be namespace-qualified. Hence you see the xmlns="" which says
that SalesOrder is not
namespace qualified.

Is there a specific reason why you are even trying to do RPC/Literal in the
first place? As far as I know, RPC/Literal support is spotty at best (even
non-existent) in the various toolkits. You should really be doing
doc/literal. And if you need rpc semantics on the server-side, you can take
a look at Axis' "wrapped" style (which is still doc-literal in the
WebServices world).

- Junaid




                                                                           
             Wei Hsu                                                       
             <whsu@openharbor.                                             
             com>                                                       To 
                                       axis-user@ws.apache.org             
             04/13/2004 03:11                                           cc 
             PM                                                            
                                                                   Subject 
                                       problem using WSDL2Java on          
             Please respond to         RPC/Literal                         
             axis-user@ws.apac                                             
                  he.org                                                   
                                                                           
                                                                           
                                                                           
                                                                           




Hi all,

I've been trying to run WSDL2Java on my RPC/Literal WSDL, but I keep
running into a seemingly simple problem.  In the WSDL, I've created a
createSalesOrderRequest message as the following:

<wsdl:message name="createSalesOrderRequest">
        <wsdl:part name="SalesOrder" type="n1:SalesOrderWrap"/>
</wsdl:message>

Here, assume n1 belongs to namespace my.example.com and the namespace of
the WSDL is "urn:SalesCreator".

But when I generate the stubs and make call with them, I found out that the
namespace for SalesOrder isn't picked up.  So the body of the SOAP message
becomes

<createSalesOrder xmlns="urn:SalesCreator">
   <SalesOrder xmlns="">

Instead of setting the xmlns for SalesOrder to that of SalesOrderWrap or
even that of the WSDL, WSDL2Java sets it to empty the namespace.  Any idea
why that's the case?

My question is, is there any thing I can add to the WSDL so that the
generated stubs will set the xmlns to something other than the empty ""?  I
know I can manually modify the stubs to insert a value.  However, that
doesn't solve my problem, since I am writing these WSDL files to be used by
other testing tools that also take advantage of axis' WSDL2Java.

Thanks so much!

Wei


RE: problem using WSDL2Java on RPC/Literal

Posted by Anne Thomas Manes <an...@manes.net>.
Actually, WSDL2Java is working properly, according to the rules defined in
the WS-I Basic Profile [1]. Even you change the schema to
elementFormDefault="qualified", the generated parameter elements should be
in no namespace.

The n1 namespace refers to the type definition, not to the element
definition. The SOAP runtime generates the element, so the element is not
defined by any schema. 

Per the WS-I BP:
<WS-I-excerpt>
5.6.20 Namespace for Part Accessors
For rpc-literal SOAP messages, WSDL 1.1 is not clear what namespace, if any,
the accessor elements for parameters and return value are a part of.
Different implementations make different choices, leading to
interoperability problems. 

R2735 A MESSAGE described with an rpc-literal binding MUST place the part
accessor elements for parameters and return value in no namespace. 
</WS-I-excerpt>

If you want the elements to be namespace qualified, then you must use
Document/Literal rather than RPC/Literal.

[1] http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.html 

Regards,
Anne

-----Original Message-----
From: Robert Lowe [mailto:rmlowe@rmlowe.com] 
Sent: Tuesday, April 13, 2004 3:28 PM
To: axis-user@ws.apache.org
Subject: RE: problem using WSDL2Java on RPC/Literal

If your schema specifies elementFormDefault="unqualified", or does not
specify the elementFormDefault attribute at all, then Axis is doing the
correct thing.

Try adding elementFormDefault="qualified" to your schema.


Best regards,

Robert Lowe
http://RMLowe.com/



-----Original Message-----
From: Wei Hsu [mailto:whsu@openharbor.com]
Sent: Wednesday, April 14, 2004 3:11 AM
To: axis-user@ws.apache.org
Subject: problem using WSDL2Java on RPC/Literal


Hi all,

I've been trying to run WSDL2Java on my RPC/Literal WSDL, but I keep running
into a seemingly simple problem.  In the WSDL, I've created a
createSalesOrderRequest message as the following:

<wsdl:message name="createSalesOrderRequest">
        <wsdl:part name="SalesOrder" type="n1:SalesOrderWrap"/>
</wsdl:message>

Here, assume n1 belongs to namespace my.example.com and the namespace of the
WSDL is "urn:SalesCreator".

But when I generate the stubs and make call with them, I found out that the
namespace for SalesOrder isn't picked up.  So the body of the SOAP message
becomes

<createSalesOrder xmlns="urn:SalesCreator">
   <SalesOrder xmlns="">

Instead of setting the xmlns for SalesOrder to that of SalesOrderWrap or
even that of the WSDL, WSDL2Java sets it to empty the namespace.  Any idea
why that's the case?

My question is, is there any thing I can add to the WSDL so that the
generated stubs will set the xmlns to something other than the empty ""?  I
know I can manually modify the stubs to insert a value.  However, that
doesn't solve my problem, since I am writing these WSDL files to be used by
other testing tools that also take advantage of axis' WSDL2Java.

Thanks so much!

Wei



RE: problem using WSDL2Java on RPC/Literal

Posted by Robert Lowe <rm...@rmlowe.com>.
If your schema specifies elementFormDefault="unqualified", or does not
specify the elementFormDefault attribute at all, then Axis is doing the
correct thing.

Try adding elementFormDefault="qualified" to your schema.


Best regards,

Robert Lowe
http://RMLowe.com/



-----Original Message-----
From: Wei Hsu [mailto:whsu@openharbor.com]
Sent: Wednesday, April 14, 2004 3:11 AM
To: axis-user@ws.apache.org
Subject: problem using WSDL2Java on RPC/Literal


Hi all,

I've been trying to run WSDL2Java on my RPC/Literal WSDL, but I keep running
into a seemingly simple problem.  In the WSDL, I've created a
createSalesOrderRequest message as the following:

<wsdl:message name="createSalesOrderRequest">
        <wsdl:part name="SalesOrder" type="n1:SalesOrderWrap"/>
</wsdl:message>

Here, assume n1 belongs to namespace my.example.com and the namespace of the
WSDL is "urn:SalesCreator".

But when I generate the stubs and make call with them, I found out that the
namespace for SalesOrder isn't picked up.  So the body of the SOAP message
becomes

<createSalesOrder xmlns="urn:SalesCreator">
   <SalesOrder xmlns="">

Instead of setting the xmlns for SalesOrder to that of SalesOrderWrap or
even that of the WSDL, WSDL2Java sets it to empty the namespace.  Any idea
why that's the case?

My question is, is there any thing I can add to the WSDL so that the
generated stubs will set the xmlns to something other than the empty ""?  I
know I can manually modify the stubs to insert a value.  However, that
doesn't solve my problem, since I am writing these WSDL files to be used by
other testing tools that also take advantage of axis' WSDL2Java.

Thanks so much!

Wei