axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Gourley (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AXIS2-5465) ADB parse issue when maxOccurs > 0, element contains an anyType sub-element, and one is nil.
Date Thu, 06 Dec 2012 21:13:09 GMT
Aaron Gourley created AXIS2-5465:
------------------------------------

             Summary: ADB parse issue when maxOccurs > 0, element contains an anyType sub-element,
and one is nil.
                 Key: AXIS2-5465
                 URL: https://issues.apache.org/jira/browse/AXIS2-5465
             Project: Axis2
          Issue Type: Bug
          Components: adb, codegen
    Affects Versions: 1.5.6, 1.5.4
         Environment: Windows
            Reporter: Aaron Gourley


ADB fails to parse subsequent elements in a list when one is encountered containing anyType
element with nil value.

Here is my schema example:

    <xs:element name="GenericParameter" type="dtns:GenericParameter" />
    <xs:complexType name="GenericParameter">
        <xs:sequence>
            <xs:element name="name" type="xs:string" />
            <xs:element name="value" nillable="true" type="xs:anyType" />
        </xs:sequence>
    </xs:complexType>

Here is how it's referenced:

    <xs:element name="getSubscriptionProfile" type="tns:getSubscriptionProfile" />
    <xs:complexType name="getSubscriptionProfile">
        <xs:sequence>
            <xs:element name="subscriptionRef" type="xs:string" />
            <xs:element name="parameters" nillable="true" minOccurs="0" maxOccurs="unbounded"
type="dtns:GenericParameter" />                    
        </xs:sequence>
     </xs:complexType>

Here is an offending message:

    <getSubscriptionProfile>
        <subscriptionRef>12345</subscriptionRef>
        <parameters>
            <name>A</name>
            <value xsi:type="xsd:long">-1</value>
        </parameters>
        <parameters>
            <name>B</name>
            <value xsi:type="xsd:long">-1</value>
        </parameters>
        <parameters>
            <name>C</name>
            <value xsi:type="xsd:string" xsi:nil="true" />
        </parameters>
        <parameters>
            <name>D</name>
            <value xsi:type="xsd:string">Hello</value>
        </parameters>
        <parameters>
            <name>E</name>
            <value xsi:type="xsd:decimal">10</value>
        </parameters>
        <parameters>
            <name>F</name>
            <value xsi:type="xsd:decimal">20</value>
        </parameters>
    </getSubscriptionProfile>

Here is a code snippet I ran to verify:

    out.println("START");
    reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(request));
    reqObject = GetSubscriptionProfile.Factory.parse(reader);
    for (Object param : reqObject.getParameters())
    {
        out.println(param.getName() + " = " + param.getValue());
    }
    out.println("END");

And here is the output from that script:

    START
    A = -1
    B = -1
    C = null
    END

Note that "E = 10" and "F = 20" are missing from the output.  The parsed parameter list is
missing all elements after the null one.

I verified the issue against both 1.5.4 and 1.5.6.  Did not try with 1.6.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message