WSDL2JAVA ignores attributes in certain schema structures
---------------------------------------------------------

         Key: AXIS-2294
         URL: http://issues.apache.org/jira/browse/AXIS-2294
     Project: Apache Axis
        Type: Bug
  Components: WSDL processing  
    Versions: 1.2, 1.2.1, 1.3    
 Environment: JDK 1.4.1
JDK 1.5
    Reporter: Marko Sormunen


WSDL2JAVA seems to ignore attributes in certain schema structures. For example:

<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="urn:plugit:CommonServices/IdentifyProfile"
 xmlns="http://schemas.xmlsoap.org/wsdl/";
 xmlns:impl="urn:plugit:CommonServices/IdentifyProfile"
 xmlns:type="urn:plugit:CommonServices/type"
 xmlns:excep="urn:plugit:CommonServices/exception"
 xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
 name="IdentifyProfile">
 <types>
  <schema targetNamespace="urn:plugit:CommonServices/IdentifyProfile" 
xmlns="http://www.w3.org/2001/XMLSchema";>
   <element name="findCandidates">
    <complexType>
     <sequence>
      <element name="coupon" type="string"/>
      <element name="findCandidate" type="type:FindCandidate"/>
      <element name="maxReturned" minOccurs="0" maxOccurs="1" type="short"/>
      <element name="maxStored" minOccurs="0" maxOccurs="1" type="short"/>
     </sequence>
    </complexType>
   </element>
   <element name="findCandidatesResponse">
    <complexType>
     <sequence>
      <element name="candidate" minOccurs="0" maxOccurs="unbounded" 
type="type:Candidate"/>
      <element name="storedCandidates" minOccurs="0" maxOccurs="1" 
type="short"/>
     </sequence>
    </complexType>
   </element>
  </schema>

  <schema targetNamespace="urn:plugit:CommonServices/type" 
xmlns="http://www.w3.org/2001/XMLSchema";>
   <complexType name="FindTrait">
    <sequence>
     <element name="caseSensitive" minOccurs="0" maxOccurs="1" type="boolean"/>
     <element name="sortDirection" minOccurs="0" maxOccurs="1" type="string"/>
     <element name="partial" minOccurs="0" maxOccurs="1" type="short"/>
     <element name="returned" minOccurs="0" maxOccurs="1" type="boolean" 
default="true"/>
     <element name="value" minOccurs="0" maxOccurs="1" type="string"/>
    </sequence>
    <attribute name="id" type="string" use="required"/>
   </complexType>

   <complexType name="FindCandidate">
    <sequence>
     <element name="findTrait" minOccurs="1" maxOccurs="unbounded" 
type="type:FindTrait"/>
    </sequence>
   </complexType>
   <complexType name="Trait">
    <sequence>
     <element name="mimeType" minOccurs="0" maxOccurs="1" type="string"/>
     <element name="value" minOccurs="0" maxOccurs="1" type="string"/>
    </sequence>
    <attribute name="id" type="string" use="required"/>
   </complexType>

   <complexType name="Candidate">
    <sequence>
     <element name="trait" minOccurs="0" maxOccurs="unbounded" 
type="type:Trait"/>
    </sequence>
    <attribute name="id" type="string" use="required"/>
   </complexType>
  </schema>
 </types>

 <message name="findCandidatesRsp">
  <part element="impl:findCandidatesResponse" name="parameters"/>
 </message>
 <message name="getMoreCandidatesRsp">
  <part element="impl:getMoreCandidatesResponse" name="parameters"/>
 </message>

(The rest of WSDL snipped)

The problem is that Candidate is not generated as a class, even though it 
should contain the id attribute. Instead a CandidateHolder class like this is 
generated:

public final class CandidateArrayHolder implements javax.xml.rpc.holders.Holder 
{
    public org.plugit.soap.type.Trait[][] value;

    public CandidateArrayHolder() {
    }

    public CandidateArrayHolder(org.plugit.soap.type.Trait[][] value) {
        this.value = value;
    }

}

When it should generate this:

public final class CandidateArrayHolder implements javax.xml.rpc.holders.Holder 
{
    public org.plugit.soap.type.Candidate[] value;

    public CandidateArrayHolder() {
    }

    public CandidateArrayHolder(org.plugit.soap.type.Candidate[] value) {
        this.value = value;
    }

}

and of course a Candidate class with a Trait-array and id property. This worked 
correctly with Axis 1.2RC3 , but not in newer versions..


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to