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 "Thomas Raddatz (JIRA)" <ji...@apache.org> on 2010/10/20 14:01:28 UTC
[jira] Created: (AXIS2-4858) Choice and sequence elements are not
serialized when part of a choice element
Choice and sequence elements are not serialized when part of a choice element
-----------------------------------------------------------------------------
Key: AXIS2-4858
URL: https://issues.apache.org/jira/browse/AXIS2-4858
Project: Axis2
Issue Type: Bug
Components: codegen
Affects Versions: 1.5
Environment: Current download
Reporter: Thomas Raddatz
Choice and sequence elements not added as part of a choice element
I have the following complex type:
<xsd:complexType name="choices">
<xsd:sequence>
<xsd:choice minOccurs="0">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="firstChildOfSequence" type="xsd:string" />
<xsd:element name="secondChildOfSequence" type="xsd:string" />
</xsd:sequence>
<xsd:choice>
<xsd:element name="firstChildOfChoice" type="xsd:string" />
<xsd:element name="secondChildOfChoice" type="xsd:string" />
</xsd:choice>
<xsd:choice>
<xsd:element name="thirdChildOfChoice" type="xsd:string" />
<xsd:element name="forthChildOfChoice" type="xsd:string" />
</xsd:choice>
</xsd:choice>
<xsd:element name="endOfMessage" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
There are two problems when parsing the request message.
The first problem is that the sequence element is not added to the outer
choice element because of a ADBException("Unexpected subelement
endOfMessage") when processing the following request:
<soapenv:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cho="http://tools400.de/wsdl2rpg/webservice/axis2/errors/choice">
<soapenv:Header/>
<soapenv:Body>
<cho:echoChoices soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<choices xsi:type="cho:choices">
<firstChildOfSequence xsi:type="xsd:string">child1</firstChildOfSequence>
<secondChildOfSequence xsi:type="xsd:string">child2</secondChildOfSequence>
<endOfMessage xsi:type="xsd:string">endOfMessage</endOfMessage>
</choices>
</cho:echoChoices>
</soapenv:Body>
</soapenv:Envelope>
The second problem is that the <firstChildOfChoice> element is added to the outer
choice element but its associated tracker value is set back to false later on. That happens
because Factory.parse() of ChoicesChoice_type1() returns an object although there is
no third and fourth "ChildOfChoice" element. In fact the object is returned because of the
<endOfMessage> element which is definitely wrong. Sample request message:
<soapenv:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cho="http://tools400.de/wsdl2rpg/webservice/axis2/errors/choice">
<soapenv:Header/>
<soapenv:Body>
<cho:echoChoices soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<choices xsi:type="cho:choices">
<firstChildOfChoice xsi:type="xsd:string">firstChildOfChoice</firstChildOfChoice>
<endOfMessage xsi:type="xsd:string">endOfMessage</endOfMessage>
</choices>
</cho:echoChoices>
</soapenv:Body>
</soapenv:Envelope>
In order to fix the problems I fixed the following files the initially had been generated
by WSDL2JAVA:
ChoicesChoice_type0.java
ChoicesChoice_type1.java
ChoicesChoice_type2.java
Please verify the changes I did and fix WSDL2JAVA.
--
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: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org
[jira] Updated: (AXIS2-4858) Choice and sequence elements are not
serialized when part of a choice element
Posted by "Thomas Raddatz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-4858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Raddatz updated AXIS2-4858:
----------------------------------
Attachment: choice_error_sample.zip
Sample WSDL file. Originally generated Java files and fixed Java files.
> Choice and sequence elements are not serialized when part of a choice element
> -----------------------------------------------------------------------------
>
> Key: AXIS2-4858
> URL: https://issues.apache.org/jira/browse/AXIS2-4858
> Project: Axis2
> Issue Type: Bug
> Components: codegen
> Affects Versions: 1.5
> Environment: Current download
> Reporter: Thomas Raddatz
> Attachments: choice_error_sample.zip
>
>
> Choice and sequence elements not added as part of a choice element
> I have the following complex type:
> <xsd:complexType name="choices">
> <xsd:sequence>
> <xsd:choice minOccurs="0">
> <xsd:sequence minOccurs="0" maxOccurs="unbounded">
> <xsd:element name="firstChildOfSequence" type="xsd:string" />
> <xsd:element name="secondChildOfSequence" type="xsd:string" />
> </xsd:sequence>
> <xsd:choice>
> <xsd:element name="firstChildOfChoice" type="xsd:string" />
> <xsd:element name="secondChildOfChoice" type="xsd:string" />
> </xsd:choice>
> <xsd:choice>
> <xsd:element name="thirdChildOfChoice" type="xsd:string" />
> <xsd:element name="forthChildOfChoice" type="xsd:string" />
> </xsd:choice>
> </xsd:choice>
> <xsd:element name="endOfMessage" type="xsd:string" />
> </xsd:sequence>
> </xsd:complexType>
> There are two problems when parsing the request message.
> The first problem is that the sequence element is not added to the outer
> choice element because of a ADBException("Unexpected subelement
> endOfMessage") when processing the following request:
> <soapenv:Envelope
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:cho="http://tools400.de/wsdl2rpg/webservice/axis2/errors/choice">
> <soapenv:Header/>
> <soapenv:Body>
> <cho:echoChoices soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <choices xsi:type="cho:choices">
> <firstChildOfSequence xsi:type="xsd:string">child1</firstChildOfSequence>
> <secondChildOfSequence xsi:type="xsd:string">child2</secondChildOfSequence>
> <endOfMessage xsi:type="xsd:string">endOfMessage</endOfMessage>
> </choices>
> </cho:echoChoices>
> </soapenv:Body>
> </soapenv:Envelope>
> The second problem is that the <firstChildOfChoice> element is added to the outer
> choice element but its associated tracker value is set back to false later on. That happens
> because Factory.parse() of ChoicesChoice_type1() returns an object although there is
> no third and fourth "ChildOfChoice" element. In fact the object is returned because of the
> <endOfMessage> element which is definitely wrong. Sample request message:
> <soapenv:Envelope
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:cho="http://tools400.de/wsdl2rpg/webservice/axis2/errors/choice">
> <soapenv:Header/>
> <soapenv:Body>
> <cho:echoChoices soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <choices xsi:type="cho:choices">
> <firstChildOfChoice xsi:type="xsd:string">firstChildOfChoice</firstChildOfChoice>
> <endOfMessage xsi:type="xsd:string">endOfMessage</endOfMessage>
> </choices>
> </cho:echoChoices>
> </soapenv:Body>
> </soapenv:Envelope>
> In order to fix the problems I fixed the following files the initially had been generated
> by WSDL2JAVA:
> ChoicesChoice_type0.java
> ChoicesChoice_type1.java
> ChoicesChoice_type2.java
> Please verify the changes I did and fix WSDL2JAVA.
--
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: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org