One thing to add. If your WSDL is doc-lit wrapped (this type of WSDL is 
generated by java2wsdl by default unless your java class has annotations to 
customize this),  a Response Bean is required to be generated by WSDL2JAVA 
tool. In this case, the WSDL2JAVA tool is also required to resolve any name 
collisions in response bean. In CXF, when JAXB is the databinding used by 
WSDL2JAVA, the name mapping is handled by JAXB, detailed can be found in JAXB 
2.0 spec Appendix D "BINDING XML NAMES TO JAVA IDENTIFIERS".

Cheers,
Jervis

> -----Original Message-----
> From: Liu, Jervis [mailto:[EMAIL PROTECTED]
> Sent: 2007?9?11? 10:47
> To: [email protected]
> Subject: RE: Elements and parts seem to default to "return" - 
> which upsets WSDL2X as "return" is generally a reserved word
> 
> 
> Jon, the mapping name of "return" is per JAX-WS 2.0 spec. 
> Section 3.6.1: 
> 
> "Conformance (Result naming): The javax.jws.WebResult 
> annotation (see 7.10.4) MAY be used to 
> specify the name of the wsdl:part or XML Schema element 
> declaration corresponding to the Java method 
> return type. If both the name and partName elements are used 
> in the javax.jws.WebResult annota- 
> tions then the partName MUST be used for the wsdl:part name 
> attribute and the name elment from the 
> annotation will be ignored. In the absence of customizations, 
> the default name is return."
> 
> As far as the WSDL2JAVA tool is concerned, the return name is 
> not significant as it is not needed by the language, only the 
> return type is significant. Or you have specific 
> WSDL2Language in your mind?
> 
> Cheers,
> Jervis
> 
> > -----Original Message-----
> > From: Jon Mountjoy [mailto:[EMAIL PROTECTED]
> > Sent: 2007?9?11? 4:46
> > To: [email protected]
> > Subject: Elements and parts seem to default to "return" - 
> > which upsets WSDL2X as "return" is generally a reserved word
> > 
> > 
> > Hi,
> > 
> > I'm new to CXF, so forgive this newb question.  For almost 
> > all simple  
> > web services that I create using Java, such as those described here:
> > http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html
> > I get parts or elements automatically named "return" in the 
> > resulting  
> > auto-generated WSDL (see example below).
> > 
> > As you'll see below, the argument is given a nice name like 
> "arg0",  
> > but the return is called "return".  Unfortunately, return is a  
> > reserved keyword in many languages, so this forces many  
> > WSDL2LanguageX converters to rename.
> > 
> > Can you change the default return name for elements/parts to  
> > something like "return0" ?  Right now, I can't use CXF web 
> services  
> > from salesforce.com without hacking all my WSDL files (or, when I  
> > have access to source, adding an annotation).
> > 
> > LMK if I've got this wrong!
> > 
> > Thanks!
> > Jon
> > 
> > 
> > 
> > <xsd:complexType name="getInfo">
> > <xsd:sequence>
> > <xsd:element minOccurs="0" name="arg0" type="xsd:string"/>
> > </xsd:sequence>
> > </xsd:complexType>
> > <xsd:element name="getInfoResponse" type="getInfoResponse"/>
> > <xsd:complexType name="getInfoResponse">
> > <xsd:sequence>
> > <xsd:element minOccurs="0" name="return" type="xsd:string"/>
> > </xsd:sequence>
> > </xsd:complexType>
> > 
> 
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, 
> Dublin 4, Ireland
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to