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:[EMAIL PROTECTED] Sent: Tuesday, April 13, 2004 3:28 PM To: [EMAIL PROTECTED] 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:[EMAIL PROTECTED] Sent: Wednesday, April 14, 2004 3:11 AM To: [EMAIL PROTECTED] 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
