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 Marcello Sales <ms...@collab.net> on 2007/04/25 18:33:37 UTC

WSDL wrongly generated using extensions...

Hello all,

 

The Apache/AXIS1.X server generates a different WSDL when I use
extensions with new attributes (on the subType). 

 

Consider myBaseType and subType... The complexContent of subtype
contains the new attributes, "valid" and "foreign"... My skeleton
implementation (on AXIS 1.x implemented at ServiceBindingImpl.java)
recognizes the attributes and everything works fine on the skeleton.
However, when the server outputs the WSDL file from the call
MyService?WSDL, the attributes are placed outside the <extension> tag...
In this way, my stubs don't recognize the attributes added on the type
sub, just the new element myElement and the inherited myname and myID. 

 

Is there any solution related with the use of extensions on AXIS 1.X or
about this? Is there a patch? The only thing I could do was to change
the schema and add new elements on the extension (increasing my
payload), and it works fine. 

 

Here is the example of my XML Schema:

 

 

            <xsd:complexType name="myBaseType">

                        <xsd:sequence>

                                    <xsd:element name="myname"
type="xsd:string" />

                        </xsd:sequence>

                        <xsd:attribute name="myID" type="xsd:int"
use="required" />

            </xsd:complexType>

            

            <xsd:complexType name="subType">

                        <xsd:complexContent>

                                    <xsd:extension
base="tns:myBaseType">

                                                <xsd:sequence>

                                                            <xsd:element
name="myElement" 

 
type="xsd:string"

 
maxOccurs="1" minOccurs="1">

 
<xsd:annotation>

 
<xsd:documentation>

 
my element

 
</xsd:documentation>

 
</xsd:annotation>

 
</xsd:element>

                                                </xsd:sequence>

                                                <xsd:attribute
name="valid" type="xsd:boolean" use="required">

 
<xsd:annotation>

 
<xsd:documentation>

 
Is valid or not

 
</xsd:documentation>

 
</xsd:annotation>

                                                </xsd:attribute>

                                                <xsd:attribute name="
foreign" type="xsd:string" use="required">

 
<xsd:annotation>

 
<xsd:documentation>

 
My Foreign key

 
</xsd:documentation>

 
</xsd:annotation>

                                                </xsd:attribute>

                                    </xsd:extension>

                        </xsd:complexContent>

            </xsd:complexType> 

 

The fragment of this document is valid by the grammar that defines the
extension element type, which states that new attributes must be as a
subtag:


Syntax

<extension
id=ID 
base=QName
any attributes
> 
(annotation?,((group|all|choice|sequence)?,
((attribute|attributeGroup)*,anyAttribute?)))
</extension>

 

            

However, when executing AXIS 1.X MyService?WSDL, the attributes from the
subType are inserted on the outer-tag of complexType instead as inner
tags of the extension.

            

            <complexType name="subType">

                        <complexContent>

                                    <extension base="tns1:myBaseType">

                                                <sequence>

                                                            <element
name="directRoles" type="tns1:myElement"/>

                                                </sequence>

                                    </extension>

                        </complexContent>

                        <attribute name="valid" type="xsd:boolean"/>

                        <attribute name="foreign" type="xsd:string"/>

            </complexType>

            

 

Thanks a lot for your attention...

               Marcello Sales - Software Engineer
(   (                
      _)__)         CollabNet, Inc.          
   .-"(    `-..-.        
  |`-._`( _.-'|  )     8000 Marina Boulevard, Suite 600
   L    ""   J  /      Brisbane, California 94005 USA
   |         |.'      
 .-J         F-.      office: +1 650.228.2632 
(   `-.___.-'   )  mobile: +1 408.679.5272  
`-._________.-'     
                skype: marcellosalesjr