axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dimuthu Gamage (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2C-826) Generated deserialize method does not handle a <sequence> nested in a <choice>
Date Tue, 11 Dec 2007 17:46:43 GMT

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

Dimuthu Gamage commented on AXIS2C-826:
---------------------------------------

Currently C templates doesn't support complexType choice. It only supports sequence and all
(And only well testsed in sequence).


> 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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Mime
View raw message