Generated client code does not handle attribute namespaces correclty.
---------------------------------------------------------------------

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



I am using the WSDL listed below.  I generated a client.  This client is 
pointing to a non-java service.  The service fails because it cannot find the 
"count" attribute for the "lookup" element.  This is because the Axis 2 client 
namespace qualified the attribute.  

I contacted the service provider and they indicated that Axis 2 should not be 
namespace qualifying the attribute.  The <xsd:schema> element in the WSDL 
specified elementFormDefault="required" but it does not specify the 
attributeFormDefault.  In the abscense of the attributeFormDefault the default 
value in "unqualified".  

I believe this means that the stub code generated by Axis 2 should not be 
namespace qualifying the attributes.

Here is the envelope the Axis 2 stub created.  Notice the "count" attribute in 
the lookup element is namespace qualified...
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
  <soapenv:Header />
  <soapenv:Body>
    <ns1:lookup xmlns:ns1="http://tempuri.org/"; ns1:count="1">
      <ns1:upc>1234567890</ns1:upc>
    </ns1:lookup>
  </soapenv:Body>
</soapenv:Envelope>

Here is the WSDL.  Notice that the <xsd:schema> element doesn't specifiy the 
attributeDefaultFormat which means it defaults to "unqualified"...

<?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="getinfo" 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:8090/POC/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