[ 
https://issues.apache.org/jira/browse/AXIS2C-1580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bill Blough updated AXIS2C-1580:
--------------------------------
    Component/s: code generation
                     (was: wsdl2c tool)

> 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: 1.7.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 &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 was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to