[
https://issues.apache.org/jira/browse/AXIS2C-1580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Lazarski resolved AXIS2C-1580.
-------------------------------------
Fix Version/s: 2.0.0
(was: 1.7.0)
Resolution: Fixed
There is now a native WSDL2C yet it did not implement xsd:any support, see
commit message below that fixed the issue:
Add defensive xsd:any type handling to native WSDL2C generator (AXIS2C-1580)
When deserializing xsd:any elements, axiom_element_get_qname() returns NULL
because xsd:any elements don't have a fixed qname. The generated
deserialization
code now checks for NULL element_qname before performing qname comparison,
preventing crashes when processing extensible schemas.
Changes:
- Add schema parsing to detect xsd:any elements in WSDL
- Generate safe deserialization code with NULL qname checks
- Add unit tests for xsd:any detection and NULL qname handling
> Generated code crashed when it deserializes 'any' type
> ------------------------------------------------------
>
> Key: AXIS2C-1580
> URL: https://issues.apache.org/jira/browse/AXIS2C-1580
> Project: Axis2-C
> Issue Type: Bug
> Components: code generation
> Affects Versions: 1.6.0
> Reporter: Hengli Wang
> Priority: Major
> Fix For: 2.0.0
>
>
> I used axis2-1.6.1 to generate code, and the generated code crashed. In the
> core dump, I found that element_qname in the deserialization code is NULL but
> is used later to compare the qname.
> Below is a patch that I used to get around this issue (the line number may
> off as I applied other patches),
> ---
> ./modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl
> 2012-01-12 13:56:41.000000000 -0500
> +++
> ./modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl
> 2012-01-12 13:58:16.000000000 -0500
> @@ -2105,15 +2105,20 @@
> is_early_node_valid = AXIS2_FALSE;
> continue;
> }
> - <xsl:if test="not(@any)">
> + <xsl:choose>
> + <xsl:when test="not(@any)">
> current_element = (axiom_element_t
> *)axiom_node_get_data_element(current_node, env);
> qname =
> axiom_element_get_qname(current_element, env, current_node);
>
> if (<xsl:if test="@ours"><xsl:value-of
> select="substring-before(@type, '_t*')"/>_is_particle() || </xsl:if> <!-- is
> particle test should be done here -->
> (current_node && current_element
> && (axutil_qname_equals(element_qname, env, qname)<xsl:if
> test="not(@nsuri) or @nsuri=''"> || !axutil_strcmp("<xsl:value-of
> select="$propertyName"/>", axiom_element_get_localname(current_element,
> env))</xsl:if>)))
> {
> - </xsl:if>
> if( current_node &&
> current_element && (axutil_qname_equals(element_qname, env,
> qname)<xsl:if test="not(@nsuri) or @nsuri=''"> ||
> !axutil_strcmp("<xsl:value-of select="$propertyName"/>",
> axiom_element_get_localname(current_element, env))</xsl:if>))
> + </xsl:when>
> + <xsl:otherwise>
> + if( current_node &&
> current_element)
> + </xsl:otherwise>
> + </xsl:choose>
> {
> is_early_node_valid = AXIS2_TRUE;
> }
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]