You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Chuck Williams <ch...@manawiz.com> on 2006/03/03 03:44:56 UTC

[Axis2 0.94] No support for recursive data types?

WSDL2Java recurses infinitely in the SchemaCompiler when it encounters
recursion in the type definitions, e.g. for this single type:

    <xsd:schema targetNamespace="test">
      <xsd:element name="recursiveElement" type="recursive"/>
      <xsd:complexType name="recursive">
        <xsd:sequence>
          <xsd:element name="sub" type="test:recursive" minOccurs="0"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:schema>

This definition validly describes a data strcuture like this one:

<recursive>
    <sub>
        <sub/>
    </sub>
</recursive>

The attached WSDL file is a simple standalone example that causes the
infinite recursion.

Is there any way to do this, or is this a bug in axis2, or am I somehow
confused?  It looks to me like the fix could be as simple as adding the
name of the complexType being processed to the processedTypemap in
SchemaCompiler.processNamedComplexSchemaType() before it is processed,
rather than waiting until after it is processed, but I'm not sure if
that woudl really work and what other consequences it might have.  There
seem to be similar issues with other recursion control mechanisms in
SchemaCompiler, e.g. in processElement().

Thanks for any help,

Chuck


Re: [Axis2 0.94] No support for recursive data types?

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi Chuck,
Hmm.. Valid scenario and humbly the recursive code that processes the
schema would have failed in this scenario. Your suggesion is right but
I'll have to go through the tests to figure out the consequences.

Ajith

On 3/3/06, Chuck Williams <ch...@manawiz.com> wrote:
> WSDL2Java recurses infinitely in the SchemaCompiler when it encounters
> recursion in the type definitions, e.g. for this single type:
>
>     <xsd:schema targetNamespace="test">
>       <xsd:element name="recursiveElement" type="recursive"/>
>       <xsd:complexType name="recursive">
>         <xsd:sequence>
>           <xsd:element name="sub" type="test:recursive" minOccurs="0"/>
>         </xsd:sequence>
>       </xsd:complexType>
>     </xsd:schema>
>
> This definition validly describes a data strcuture like this one:
>
> <recursive>
>     <sub>
>         <sub/>
>     </sub>
> </recursive>
>
> The attached WSDL file is a simple standalone example that causes the
> infinite recursion.
>
> Is there any way to do this, or is this a bug in axis2, or am I somehow
> confused?  It looks to me like the fix could be as simple as adding the
> name of the complexType being processed to the processedTypemap in
> SchemaCompiler.processNamedComplexSchemaType() before it is processed,
> rather than waiting until after it is processed, but I'm not sure if
> that woudl really work and what other consequences it might have.  There
> seem to be similar issues with other recursion control mechanisms in
> SchemaCompiler, e.g. in processElement().
>
> Thanks for any help,
>
> Chuck
>
>
>
>


--
Ajith Ranabahu