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 Sarathi Balasundaram <bs...@gmail.com> on 2009/07/31 14:11:59 UTC

WSDL - Complex type element not getting populated

Hi there

I have the following complex types in wsdl definition

<xs:complexType name="Worker">
        <xs:complexContent>
                <xs:extension base="cap:Employee">
                    </xs:extension>
        </xs:complexContent>
</xs:complexType>

<xs:complexType name="Manager">
        <xs:complexContent>
       <xs:extension base="cap:Employee">
           </xs:extension>
        </xs:complexContent>
</xs:complexType>


The complex types Manager and Worker are referred as below with in WSDL in
2 places

<xs:element name="response" >
   <xs:complexType>
        <xs:sequence>
  <xs:element maxOccurs="unbounded" minOccurs="0" nillable="true"
name="worker" type="cap:Worker"/>
        <xs:element maxOccurs="unbounded" minOccurs="0" nillable="true"
name="manager" type="cap:Manager"/>
       </xs:sequence>
   </xs:complexType>
</xs:element>

<xs:element name="statusresponse" >
   <xs:complexType>
        <xs:sequence>
       <xs:element minOccurs="0" nillable="true" name="worker"
type="cap:Worker"/>
            <xs:element minOccurs="0" nillable="true" name="manager"
type="cap:Manager"/>
       </xs:sequence>
   </xs:complexType>
</xs:element>

I am using Axis 2 1.4 for code generation.
The issue that I am having is as below

1. The SOAP XML that uses "response" element defined above only returns the
first element i.e "worker" in this case and doesnt return the secod element
i.e "manager". I have checked and found that there is data available for
both Worker and Manager
2. If I comment out the entry for Worker and Manager in "statusresponse",
then the soap XML returns both the elements in "response".

I tried setting id attribute to element but that didnt work

How do I make the element definitions unique to make these work?

Any help would be much appreciated.

thanks
Sarathi