choice of sequence of union causes infinite loop in generated ADB binding
-------------------------------------------------------------------------

                 Key: AXIS2-3401
                 URL: https://issues.apache.org/jira/browse/AXIS2-3401
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb, wsdl
    Affects Versions: 1.3
         Environment: Eclipse (Europa) with Axis2 Code generated by the Code 
Generator Wizard
            Reporter: Christoph Ludwig


We have a WSDL file that contains a schema similar to the following snippet:

                        <xsd:complexType name="dateType">
                                <xsd:choice>
                                        <xsd:sequence>
                                                <xsd:element name="notBefore"
                                                        
type="tns:DateOrDateTime" minOccurs="1" maxOccurs="1">
                                                </xsd:element>
                                                <xsd:element name="notAfter"
                                                        
type="tns:DateOrDateTime" minOccurs="0" maxOccurs="1">
                                                </xsd:element>
                                        </xsd:sequence>
                                        <xsd:element name="notAfter"
                                                type="tns:DateOrDateTime" 
minOccurs="1" maxOccurs="1">
                                        </xsd:element>
                                </xsd:choice>
                        </xsd:complexType>

                        <xsd:simpleType name="DateOrDateTime">
                                <xsd:union memberTypes="xsd:dateTime 
xsd:date"></xsd:union>
                        </xsd:simpleType>

The intention is that an element of type DateType has two optional elements 
notBefore and notAfter, but at least one of these elements has to be there.

However, the generated DateType.parse(javax.xml.stream.XMLStreamReader reader) 
enters an infinite loop when both elements are provided. The problem is that it 
correctly evaluates the type attribute in the notBefore element in 
DateTypeSequence_type0.parse(javax.xml.stream.XMLStreamReader reader), but 
fails to find the Java class this type is bound to.

The generated code exhibits another problem as well, I think: When parsing an 
element of Type DateOrDateTime, it expects a type attribut. But if there is no 
type attribute, then it should try the various union types in the order of 
their declaration, cf. section 2.5.1.3 of 
<URL:http://www.w3.org/TR/xmlschema-2/#atomic-vs-list>. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to