wsdl2java generates invalid wsdl
--------------------------------

                 Key: AXIS2-1117
                 URL: http://issues.apache.org/jira/browse/AXIS2-1117
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: Tools
         Environment: Java 1.4.2, Axis2 nightly build from 9/7/2006
            Reporter: Todd Doolittle



I used wsdl2java to create a service.  The wsdl I used contained anonymous 
inner complex types.  The new WSDL that wsd2java created and put in the 
resource directory created the inner complex types with a name= attribute in 
the ComplextType tag which I believe is invalid.  The full original WSDL is 
listed at the bottom.  Here is a snippet of example WSDL to simplying 
illustrating the problem...

Here are the type definitions.  Notice the annonymous inner complex type for 
the address...

<xsd:element name="person">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element name="firstName" type="xsd:string" />
      <xsd:element name="lastName" type="xsd:string" />
      <xsd:element name="address" nillable="true">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="address" type="xsd:string" />
            <xsd:element name="city" type="xsd:string" />
            <xsd:element name="state" type="xsd:string" />
            <xsd:element name="zip" type="xsd:int" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>

After running wsdl2java to create a service, the WSDL is creates and puts in 
the resource directory would look like this snippet....

<xsd:element name="person">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element name="firstName" type="xsd:string" />
      <xsd:element name="lastName" type="xsd:string" />
      <xsd:element name="address" nillable="true">
        <xsd:complexType name="address_type1">
          <xsd:sequence>
            <xsd:element name="address" type="xsd:string" />
            <xsd:element name="city" type="xsd:string" />
            <xsd:element name="state" type="xsd:string" />
            <xsd:element name="zip" type="xsd:int" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>

Notice in the above snippet, wsdl2java added the name="address_type0" to the 
anonymous inner ComplexType for the address.  I do not believe an inner complex 
type is allowed to have a name attribute.  At least my IDE flags it as an error.

Below is the real full WSDL I used with wsdl2java.  Below that is the resulting 
wsdl that wsdl2java placed in the resource directory that appears to be invalid.

Original WSDL...
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
  name="POC" targetNamespace="http://tempuri.org/";
  xmlns:fjs="http://tempuri.org/";
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
  xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
  <wsdl:types>
    <xsd:schema elementFormDefault="qualified"
      targetNamespace="http://tempuri.org/";
      xmlns:s1="http://tempuri.org/";>
      <xsd:element name="lookup">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element maxOccurs="unbounded" minOccurs="0"
              name="upc" nillable="true" type="xsd:string" />
          </xsd:sequence>
          <xsd:attribute name="count" type="xsd:int"
            use="required" />
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="GetinfoResponse">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="items" nillable="true">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element maxOccurs="unbounded"
                    minOccurs="0" name="item" nillable="true">
                    <xsd:complexType>
                      <xsd:sequence>
                        <xsd:element name="ksn"
                          nillable="true" type="xsd:int" />
                        <xsd:element name="upc"
                          nillable="true" type="xsd:string" />
                        <xsd:element
                          name="maintdt" nillable="true" type="xsd:date" />
                        <xsd:element name="dpt"
                          nillable="true" type="xsd:int" />
                      </xsd:sequence>
                    </xsd:complexType>
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:sequence>
          <xsd:attribute name="count" type="xsd:int"
            use="required" />
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="GetinfoIn">
    <wsdl:part element="fjs:lookup" name="parameters" />
  </wsdl:message>
  <wsdl:message name="GetinfoOut">
    <wsdl:part element="fjs:GetinfoResponse" name="parameters" />
  </wsdl:message>
  <wsdl:portType name="POCPortType">
    <wsdl:operation name="Getinfo">
      <wsdl:input message="fjs:GetinfoIn" name="lookup" />
      <wsdl:output message="fjs:GetinfoOut"
        name="GetinfoResponse" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="POCBinding" type="fjs:POCPortType">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; />
    <wsdl:operation name="Getinfo">
      <soap:operation soapAction="" style="document" />
      <wsdl:input name="lookup">
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output name="GetinfoResponse">
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="POC">
    <wsdl:port binding="fjs:POCBinding" name="POCPortType">
      <soap:address location="http://localhost:8080/axis2/services/POC"; />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>


The generated invalid WSDL from wsdl2java...

<wsdl:definitions xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/";
  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
  xmlns:fjs="http://tempuri.org/";
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
  targetNamespace="http://tempuri.org/";>
  <wsdl:types>
    <xsd:schema targetNamespace="http://tempuri.org/";
      attributeFormDefault="unqualified" elementFormDefault="qualified">
      <xsd:element name="lookup">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="upc" maxOccurs="unbounded"
              minOccurs="0" type="xsd:string" nillable="true" />
          </xsd:sequence>
          <xsd:attribute name="count" type="xsd:int"
            use="required" />
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="GetinfoResponse">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="items" nillable="true">
              <xsd:complexType name="items_type1">
                <xsd:sequence>
                  <xsd:element name="item"
                    maxOccurs="unbounded" minOccurs="0" nillable="true">
                    <xsd:complexType
                      name="item_type0">
                      <xsd:sequence>
                        <xsd:element name="ksn"
                          type="xsd:int" nillable="true" />
                        <xsd:element name="upc"
                          type="xsd:string" nillable="true" />
                        <xsd:element
                          name="maintdt" type="xsd:date" nillable="true" />
                        <xsd:element name="dpt"
                          type="xsd:int" nillable="true" />
                      </xsd:sequence>
                    </xsd:complexType>
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:sequence>
          <xsd:attribute name="count" type="xsd:int"
            use="required" />
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="GetinfoIn">
    <wsdl:part name="part1" element="fjs:lookup" />
  </wsdl:message>
  <wsdl:message name="GetinfoOut">
    <wsdl:part name="part1" element="fjs:GetinfoResponse" />
  </wsdl:message>
  <wsdl:portType name="POCPortType">
    <wsdl:operation name="Getinfo">
      <wsdl:input
        xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl";
        message="fjs:GetinfoIn"
        wsaw:Action="http://tempuri.org/POCPortType/lookup"; />
      <wsdl:output
        xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl";
        message="fjs:GetinfoOut"
        wsaw:Action="http://tempuri.org/POCPortType/GetinfoResponse"; />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="POCSOAP11Binding" type="fjs:POCPortType">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http";
      style="document" />
    <wsdl:operation name="Getinfo">
      <soap:operation
        soapAction="http://tempuri.org/POCPortType/lookup"; style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="POCSOAP12Binding" type="fjs:POCPortType">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http";
      style="document" />
    <wsdl:operation name="Getinfo">
      <soap12:operation
        soapAction="http://tempuri.org/POCPortType/lookup"; style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="POC">
    <wsdl:port name="POCSOAP11port_http"
      binding="fjs:POCSOAP11Binding">
      <soap:address
        location="http://localhost:8080/axis2/services/POC"; />
    </wsdl:port>
    <wsdl:port name="POCSOAP12port_http"
      binding="fjs:POCSOAP12Binding">
      <soap12:address
        location="http://localhost:8080/axis2/services/POC"; />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>



-- 
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to