axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hyzer <>
Subject Re: java2wsdl customize the "return" element name
Date Mon, 10 Mar 2008 03:27:11 GMT
Thank you for your attention, but it is not a soap stack issue.  It is an XML parsing issue.
 Some scripting languages convert the XML to an object model (neat trick), so any keyword
(e.g. "function", "var", whatever) would make it fail.  So it would be nice to not force people
use keywords in their XML...  Granted its difficult to forsee what all keywords are in all
programming languages, but "return" seems like a sure bet.  :)  Is there a way to customize


----- Original Message ----
From: Anne Thomas Manes <>
To:; Chris Hyzer <>
Sent: Sunday, March 9, 2008 3:15:07 PM
Subject: Re: java2wsdl customize the "return" element name

File a bug report with Adobe. A SOAP stack should not barf on a valid
NCName like "return".


On Sat, Mar 8, 2008 at 11:53 PM, Chris Hyzer <> wrote:
> Hey,
> Im using Axis2 (latest) and all defaults for inputs to Java2WSDL.  I have a
> simple service, and each operation has a "return" element in it.  e.g.
> <xs:element name="addMemberSimpleResponse">
>  <xs:complexType>
>    <xs:sequence>
>      <xs:element minOccurs="0" name="return" nillable="true"
> type="ns:WsAddMemberResult"/>
>    </xs:sequence>
>  </xs:complexType>
> </xs:element>
> This means the XML that comes back looks like this:
> <soapenv:Body>
>  <ns:addMemberSimpleResponse xmlns:ns="http://webservices.whatever/xsd">
>    <ns:return type="whatever.webservices.WsAddMemberResult">
>      <ns:resultCode xmlns:xsi=""
> xsi:nil="true" />
> I have someone connecting to the web service using flash or flex, and there
> is an XML -> object converter, which converts the XML into a hierarchy of
> objects and fields.  But since "return" is a keyword, it barfs.  So, I was
> wondering if there is a way (besides hand-editing the WSDL or using XSLT) to
> customize java2wsdl to get that element to be generated as "the_return" or
> something else besides "return".
> Thanks!
> Chris
> Here is the email from the user:
> Notice that the element name on line two of the response is named "return"
> (forget about the "ns" namespace for now).  This is perfectly legal XML but
> "return" is a reserved word in most languages and attempts to access the
> element directly cause problems when compiling the code.  e.g.
> var test : XML = XML("<top><body>hello world</body><return>good
> bye</return></top>"); // casts string to xml
> debugit.text = test.body;
> debugit.text = test.child( "return" );
> All of the above code works fine.  Notice that I access the "body"
> element directly but accessed the "return" element using a child method.
> The compiler complains if I attempt to use the syntax "test.return" or any
> variation of it: "test.return.toString()".
> Naming an element "return" is valid; I'm suggesting that it is probably not
> good practice to use common reserve words as element names (or attribute
> names for that matter).
> ----
>  ________________________________
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
> now.

To unsubscribe, e-mail:
For additional commands, e-mail:

Never miss a thing.  Make Yahoo your home page.
View raw message