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: wsdl2c tool
    Affects Versions: 1.6.0
            Reporter: Hengli Wang


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 &amp;&amp; current_element 
&amp;&amp; (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 &amp;&amp; 
current_element &amp;&amp; (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 &amp;&amp; 
current_element)
+                                  </xsl:otherwise>
+                                  </xsl:choose>
                                       {
                                           is_early_node_valid = AXIS2_TRUE;
                                       }


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscr...@axis.apache.org
For additional commands, e-mail: c-dev-h...@axis.apache.org

Reply via email to