[ https://issues.apache.org/jira/browse/AXIS2-4858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14520964#comment-14520964 ]
vaikunda jothi commented on AXIS2-4858: --------------------------------------- I am facing the same issue with axis 1.5.1. In our xsd we have <xsd:complexType name="single_logical_expr"> <xsd:choice> <xsd:element name="and_expr" type="cms-filter:and_expr"/> <xsd:element name="or_expr" type="cms-filter:or_expr"/> <xsd:element name="not_expr" type="cms-filter:not_expr"/> <xsd:element name="simple_expr" type="cms-filter:simple_expr"/> </xsd:choice> </xsd:complexType> But the generated code And_expr.java and Or_expr.java are entirely different to each other. So if we have the request contains and_exp it is working fine, but if the request contains or_expr it is not working and giving error as "Unexpected subelement" > 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 was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org For additional commands, e-mail: java-dev-h...@axis.apache.org