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 Jeff <je...@cogentlogic.com> on 2004/12/28 07:09:54 UTC

WSDL2Java bug in Axis 1.2 (and 1.2.1)

Here's a WSDL2Java bug in Axis 1.2 (and 1.2.1)


This pattern:

<element name="MyElement" type="abc:MyType"/>
  <complexType name="MyType">
    <sequence>
      <element ref="abc:MyOtherElement" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </complexType>
<element>

causes WSDL2Java to throw:

    java.io.IOException: Type {http://ay-bee-cee/}MyOtherElement is referenced but not defined


maxOccurs="unbounded" is causing the problem because this pattern:

<element name="MyElement" type="abc:MyType"/>
  <complexType name="MyType">
    <sequence>
      <element ref="abc:MyOtherElement" minOccurs="0"/>
    </sequence>
  </complexType>
<element>

does not throw an exception, though it's too far from what I want. I discovered, however, that this pattern:

<element name="MyElement" type="abc:MyType"/>
  <complexType name="MyType">
    <sequence>
      <element ref="abc:MyUnwantedElement" minOccurs="0"/>
      <element ref="abc:MyOtherElement" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </complexType>
<element>

didn't throw an exception either and it produced code from which I could easily remove MyUnwantedElement-related content.


Jeff Lawson

Re: WSDL2Java bug in Axis 1.2 (and 1.2.1)

Posted by Jeff <je...@cogentlogic.com>.
Sorry Anne, it was 1:00 a.m. and I was falling asleep. (The trailing slash
in the element declarations indicates my 'cut and paste' typo.) I should
have sent:

This pattern:

<element name="MyElement" type="abc:MyType"/>
<complexType name="MyType">
  <sequence>
    <element ref="abc:MyOtherElement" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>


causes WSDL2Java to throw:

    java.io.IOException: Type {http://ay-bee-cee/}MyOtherElement is
referenced but not defined


maxOccurs="unbounded" is causing the problem because this pattern:

<element name="MyElement" type="abc:MyType"/>
<complexType name="MyType">
  <sequence>
    <element ref="abc:MyOtherElement" minOccurs="0"/>
  </sequence>
</complexType>


does not throw an exception, though it's too far from what I want. I
discovered, however, that this pattern:

<element name="MyElement" type="abc:MyType"/>
<complexType name="MyType">
  <sequence>
    <element ref="abc:MyUnwantedElement" minOccurs="0"/>
    <element ref="abc:MyOtherElement" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>


didn't throw an exception either and it produced code from which I could
easily remove MyUnwantedElement-related content.


Jeff Lawson







----- Original Message ----- 
From: "Anne Thomas Manes" <at...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Saturday, May 28, 2005 9:03 AM
Subject: Re: WSDL2Java bug in Axis 1.2 (and 1.2.1)


Jeff,

None of these structures is valid schema. Could you try your test
again with valid structures?

This is valid:

<element name="MyElement" type="abc:MyType"/>
<complexType name="MyType">
    <sequence>
      <element ref="abc:MyOtherElement" minOccurs="0"
maxOccurs="unbounded"/>
    </sequence>
</complexType>

And this is valid:

<element name="MyElement">
  <complexType>
    <sequence>
      <element ref="abc:MyOtherElement" minOccurs="0"
maxOccurs="unbounded"/>
    </sequence>
  </complexType>
</element>

Thanks,
Anne


On 12/28/04, Jeff <je...@cogentlogic.com> wrote:
>
> Here's a WSDL2Java bug in Axis 1.2 (and 1.2.1)
>
>
> This pattern:
>
> <element name="MyElement" type="abc:MyType"/>
>   <complexType name="MyType">
>     <sequence>
>       <element ref="abc:MyOtherElement" minOccurs="0"
> maxOccurs="unbounded"/>
>     </sequence>
>   </complexType>
> <element>
>
> causes WSDL2Java to throw:
>
>     java.io.IOException: Type
> {http://ay-bee-cee/}MyOtherElement is referenced but not
> defined
>
>
> maxOccurs="unbounded" is causing the problem because this pattern:
>
> <element name="MyElement" type="abc:MyType"/>
>   <complexType name="MyType">
>     <sequence>
>       <element ref="abc:MyOtherElement" minOccurs="0"/>
>     </sequence>
>   </complexType>
> <element>
>
> does not throw an exception, though it's too far from what I want. I
> discovered, however, that this pattern:
>
>
> <element name="MyElement" type="abc:MyType"/>
>   <complexType name="MyType">
>     <sequence>
>       <element ref="abc:MyUnwantedElement" minOccurs="0"/>
>       <element ref="abc:MyOtherElement" minOccurs="0"
> maxOccurs="unbounded"/>
>     </sequence>
>   </complexType>
> <element>
>
> didn't throw an exception either and it produced code from which I could
> easily remove MyUnwantedElement-related content.
>
>
> Jeff Lawson
>


Re: WSDL2Java bug in Axis 1.2 (and 1.2.1)

Posted by Anne Thomas Manes <at...@gmail.com>.
Jeff, 

None of these structures is valid schema. Could you try your test
again with valid structures?

This is valid:

<element name="MyElement" type="abc:MyType"/>
<complexType name="MyType">
    <sequence>
      <element ref="abc:MyOtherElement" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
</complexType>

And this is valid:

<element name="MyElement">
  <complexType>
    <sequence>
      <element ref="abc:MyOtherElement" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </complexType>
</element>

Thanks,
Anne


On 12/28/04, Jeff <je...@cogentlogic.com> wrote:
>  
> Here's a WSDL2Java bug in Axis 1.2 (and 1.2.1) 
>   
>   
> This pattern: 
>   
> <element name="MyElement" type="abc:MyType"/>
>   <complexType name="MyType">
>     <sequence>
>       <element ref="abc:MyOtherElement" minOccurs="0"
> maxOccurs="unbounded"/>
>     </sequence>
>   </complexType>
> <element> 
>   
> causes WSDL2Java to throw: 
>   
>     java.io.IOException: Type
> {http://ay-bee-cee/}MyOtherElement is referenced but not
> defined 
>   
>   
> maxOccurs="unbounded" is causing the problem because this pattern: 
>   
> <element name="MyElement" type="abc:MyType"/>
>   <complexType name="MyType">
>     <sequence>
>       <element ref="abc:MyOtherElement" minOccurs="0"/>
>     </sequence>
>   </complexType>
> <element> 
>   
> does not throw an exception, though it's too far from what I want. I
> discovered, however, that this pattern: 
>  
>   
> <element name="MyElement" type="abc:MyType"/>
>   <complexType name="MyType">
>     <sequence>
>       <element ref="abc:MyUnwantedElement" minOccurs="0"/>
>       <element ref="abc:MyOtherElement" minOccurs="0"
> maxOccurs="unbounded"/>
>     </sequence>
>   </complexType>
> <element> 
>   
> didn't throw an exception either and it produced code from which I could
> easily remove MyUnwantedElement-related content. 
>   
>   
> Jeff Lawson 
>