[
https://issues.apache.org/jira/browse/AXIS2C-753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dimuthu Gamage resolved AXIS2C-753.
-----------------------------------
Resolution: Fixed
Fixed in the Axis2/Java svn revision 598207
> Program crashes if optional elements are not provided
> -----------------------------------------------------
>
> Key: AXIS2C-753
> URL: https://issues.apache.org/jira/browse/AXIS2C-753
> Project: Axis2-C
> Issue Type: Bug
> Components: code generation
> Affects Versions: 1.1.0
> Reporter: Michael Mole
> Priority: Critical
> Attachments: case19.tar.gz
>
>
> I am using the code generation tool from approx. 11/1/2007 Axis2/Java nightly
> snapshot. I am using it to generate C databindings
> My generated adb databinding code is writing elements in the serialize method
> even when minOccurs="0". I think if anything has a minOccurs="0", the
> generated serialize should check if the element has been provided by
> surrounding the code block with an "if ( foo-element !- NULL )". Otherwise,
> the program will crash if the optional element has not been provided.
> I have a datatype defined as follows:
> <complexType name="Foo">
> <sequence>
> <element name="foo-element" type="foo_type"
> minOccurs="0">
> </element>
> </sequence>
> </complexType>
> In my serialize method I'm seeing something like this:
> start_input_str = "<ns2:foo-element";
>
> start_input_str_len = axutil_strlen(start_input_str);
> end_input_str = "</ns2:foo-element>";
> end_input_str_len = axutil_strlen(end_input_str);
>
> axutil_stream_write(stream, env, start_input_str,
> start_input_str_len);
>
> adb_foo-element_serialize(_Foo->foo-element,
>
> env, current_node,
> AXIS2_FALSE
> );
>
> axutil_stream_write(stream, env, end_input_str,
> end_input_str_len);
--
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]