[
https://issues.apache.org/jira/browse/AXIS2C-826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dimuthu Gamage updated AXIS2C-826:
----------------------------------
Attachment: choice_test.tar.gz
The wsdl in the attached gzip (case27/res/Choice_new.wsdl) contain all the
scenarios mentioned in the JIRA. Please reopen this JIRA, if this doesnt work
for other scenarios related with 'choice' elements.
Thanks
Dimuthu
> Generated deserialize method does not handle a <sequence> nested in a <choice>
> ------------------------------------------------------------------------------
>
> Key: AXIS2C-826
> URL: https://issues.apache.org/jira/browse/AXIS2C-826
> Project: Axis2-C
> Issue Type: Improvement
> Components: code generation
> Reporter: Michael Mole
> Assignee: Dimuthu Gamage
> Attachments: choice_test.tar.gz
>
>
> I have a schema with a complex type as follows:
> <complexType name="FooResponse">
> <sequence>
> <element name="record-id" type="string">
> </element>
> <choice>
> <sequence>
> <element name="changed-value" type="string" minOccurs="0">
> </element>
> <element name="state" type="string">
> </element>
> </sequence>
> <group ref="WSX:MyResultGroup"/>
> </choice>
> </sequence>
> </complexType>
> The generated deserialize method looks like this (this is a snippet):
> /*
> * because elements are not ordered we should
> surf all the sibling to pick the right one
> */
> for (current_node = first_node; current_node
> != NULL;
> current_node =
> axiom_node_get_next_sibling(current_node, env))
> {
> current_element = (axiom_element_t
> *)axiom_node_get_data_element(current_node, env);
> qname =
> axiom_element_get_qname(current_element, env, current_node);
>
> element_qname = axutil_qname_create(env,
> "FooResponseSequence_type0", "http://ibm.com/ws", NULL);
> if (axutil_qname_equals(element_qname, env,
> qname))
> {
> /* found the requried element */
> break;
> }
> }
> The generated code is looking for the a qname containing
> "FooResponseSequence_type0" which is the generated name for the adb sequence
> struct. It should not be looking for this though. It should actually be
> looking for the first element in the sequence, "changed-value".
> Admittedly, I don't know exactly how this should be formed, but I printed up
> the value of qname and it looks like this: changed-value|http://ibm.com/ws|WSX
> Please let me know if further explanation is needed, and I'll try to supply
> more.
--
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]