[ 
https://issues.apache.org/jira/browse/AXIS2C-826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12550663
 ] 

Michael Mole commented on AXIS2C-826:
-------------------------------------

I'm also seeing that a choice in a sequence is not handled such as here:

<complexType name="FooResponse">
    <sequence>
        <choice minOccurs="0">
            <element name="context" type="string">
            </element>
            <group ref="WSX:BarResultGroup" /> 
       </choice>
       <group ref="WSX:SomeGroup" /> 
       </sequence>
</complexType>

> 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: Bug
>          Components: code generation
>            Reporter: Michael Mole
>
> 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]

Reply via email to