You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2002/10/09 06:00:31 UTC

DO NOT REPLY [Bug 13439] New: - Incorrect code generated from xsd:choice element in WSDL

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13439>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13439

Incorrect code generated from xsd:choice element in WSDL

           Summary: Incorrect code generated from xsd:choice element in WSDL
           Product: Axis
           Version: current (nightly)
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: WSDL processing
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: douglas.bitting@agile.com


In one of the test cases (test\wsdl\types\ComprehensiveTypes.wsdl), you'll find 
the following schema definition:

---- snip here ----
      <xsd:complexType name="complexChoice">
        <xsd:choice>
          <xsd:element name="choiceA" type="xsd:int"/>
          <xsd:element name="choiceB" type="xsd:string"/>
          <xsd:element name="choiceC" type="xsd:string"/>
        </xsd:choice>
      </xsd:complexType>
---- snip here ----

When run through WSDL2Java, it generates the attached ComplexChoice.java file.  
This compiles and runs fine.  However, the SOAP request generated with this 
ends up with something like the following XML fragment (assuming an element 
named complexChoice):

---- snip here ----
<complexChoice>
  <choiceA>1</choiceA>
  <choiceB xsi:null="true"/>
  <choiceC xsi:null="true"/>
</complexChoice>
---- snip here ----

The above is not valid XML.