[
https://issues.apache.org/jira/browse/AXIS2C-1182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Lazarski resolved AXIS2C-1182.
-------------------------------------
Fix Version/s: 2.0.0
Resolution: Fixed
The add_ functions for array properties (maxOccurs > 1) were producing
empty XML tags because the struct used a single pointer instead of an
array list, causing values to be overwritten on each add_ call.
Changes:
- Use axutil_array_list_t* for array elements in generated structs
- Generate add_X(), get_X_at(), sizeof_X() array accessor functions
- Box primitive types (int, bool, double) when adding to arrays since
axutil_array_list stores void pointers
- Update serialization to loop through arrays creating separate XML elements
- Update deserialization to collect repeated elements into array list
- Properly free boxed primitives and array contents in destructor
Also fixes compilation errors for nested arrays containing primitive types
(e.g., int maxOccurs="unbounded") by boxing/unboxing values properly.
Includes 8 unit tests covering array struct type, accessor functions,
serialization, deserialization, header declarations, and destructor.
> adb_XXXX_add_nodes(_XXXX, env, _Y) FAILURES
> --------------------------------------------
>
> Key: AXIS2C-1182
> URL: https://issues.apache.org/jira/browse/AXIS2C-1182
> Project: Axis2-C
> Issue Type: Bug
> Components: wsdl2c tool
> Affects Versions: 1.4.0
> Environment: Linux Ubuntu 8.04 - Axis2/c binary distro
> Reporter: Samuel Vrech
> Priority: Major
> Fix For: 2.0.0
>
>
> Producing Stub code with WSDL2C Tool and adb support:
> I try to set a Complex object defined as:
> <xsd:group name="Where">
> <xsd:choice>
> <xsd:element name="where" type="cms:Predicate"
> maxOccurs="1" minOccurs="0" nillable="true"></xsd:element>
> <xsd:element name="where_id" type="xsd:string"
> maxOccurs="1" minOccurs="0" nillable="true"></xsd:element>
> </xsd:choice>
> </xsd:group>
> and Predicate defined as:
> <xsd:complexType name="Predicate">
> <xsd:choice>
> <xsd:element name="nodes" type="cms:Reference"
> maxOccurs="unbounded" minOccurs="0" nillable="true">
> </xsd:element>
> <xsd:sequence>
> <xsd:element name="store" type="cms:Store"
> maxOccurs="1" minOccurs="0" nillable="true"></xsd:element>
> <xsd:element name="query" type="cms:Query"
> maxOccurs="1" minOccurs="0" nillable="true"></xsd:element>
> </xsd:sequence>
> </xsd:choice>
> </xsd:complexType>
> I try to use the add_ style for the lists:
> ...
> adb_Predicate_t* _Predicate = adb_Predicate_create(env );
> adb_Predicate_add_nodes(_Predicate, env, _Reference);
> ...
> but tracing the payload:
> <n:statements><n0:update>
> <n0:property><n1:name>{f12.model}barcode</n1:name><n1:isMultiValue
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:nil="1"/><n1:value>CANINO</n1:value>
> </n0:property>
> <n0:where></n0:where>
> </n0:update></n:statements></n:update>
> tag <n0:where> is empty!
> but using set-like method:
> ....
> adb_Predicate_t* _Predicate = adb_Predicate_create(env );
> axutil_array_list_t* arg_nodes = axutil_array_list_create(env,1);
> axutil_array_list_add(arg_nodes,env,_Reference);
>
> adb_Predicate_set_nodes(_Predicate,env,arg_nodes);
> ...
> code produce the right xml:
> <n:statements><n0:update>
> <n0:property><n1:name>{f12.model}barcode</n1:name><n1:isMultiValue
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:nil="1"/><n1:value>CANINO</n1:value></n0:property>
> <n0:where>
>
> <n1:nodes><n1:store><n1:scheme>workspace</n1:scheme><n1:address>SpacesStore</n1:address></n1:store>
>
>
> <n1:uuid>4b55afc9-3306-11dd-8dfe-89b701564e99</n1:uuid></n1:nodes>
> </n0:where>
> </n0:update>
> </n:statements>
> <n0:where> filled in the right way!
> Tracing the payload and ret_node:
> ret_node = axis2_svc_client_send_receive_with_op_qname( svc_client, env,
> op_qname, payload);
> sometimes the procedures fails to decode the "right" traced XML. Probably
> because the same issue?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]