DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17541>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17541

bug in wsdl2java for type with optional field

           Summary: bug in wsdl2java for type with optional field
           Product: Axis
           Version: 1.1RC1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: WSDL processing
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


In the wsdl file added below I have defined a type id with one field id of type 
double which is optional (minOccurs = "0"). When the request is executed with 
axis1.0 generated proxies, this id field is (correctly) encoded as
    <id xsi:type="xsd:double">0.0</id>
(with xsd="http://www.w3.org/2001/XMLSchema";) which is ok.

With axis 1.1RC1 however, the field is encoded as
    <id xsi:type="soapenc:double">0.0</id>
                  ^^^^^^^
(with soapenc="http://schemas.xmlsoap.org/soap/encoding/";). 
The type specified here is wrong. If I see it right, in the generated class Id 
(the class for the type I defined) the type of the id field is set with the 
statement
    elemField.setXmlType(
        new javax.xml.namespace.QName(
           "http://schemas.xmlsoap.org/soap/encoding/";, 
           "double"));
which seems to be wrong.

Thanks,
- Dominik


<?xml version="1.0" encoding="UTF-8"?>
<definitions 
      targetNamespace="http://localhost:8080/axis/services/HelloServer"; 
      xmlns="http://schemas.xmlsoap.org/wsdl/"; 
      xmlns:serviceNS="http://localhost:8080/axis/services/HelloServer"; 
      xmlns:aaa="http://www.gruntz.ch/schemas/aaa";
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";  
      xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

   <types>
      <xsd:schema 
            xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; 
            targetNamespace="http://www.gruntz.ch/schemas/aaa";>
         <xsd:element name="id" type="aaa:id"/>
         <xsd:complexType name="id">
            <xsd:all>
               <xsd:element name="id" type="xsd:double" minOccurs="0"/>
            </xsd:all>
         </xsd:complexType>
      </xsd:schema>
   </types>

   <message name="helloRequest">
      <part name="id" type="aaa:id"/>
   </message>
   <message name="helloResponse">
      <part name="sayHelloToResult" type="xsd:string"/>
   </message>

   <portType name="HelloServerPortType">
      <operation name="sayHelloTo">
         <input message="serviceNS:helloRequest"/>
         <output message="serviceNS:helloResponse"/>
      </operation>
   </portType>
   
   <binding name="HelloServerSoapBinding" type="serviceNS:HelloServerPortType">
      <soap:binding style="rpc" 
              transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="sayHelloTo">
         <soap:operation soapAction="" style="rpc"/>
         <input>
            <soap:body 
               encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; 
               namespace="HelloServer" use="encoded"/>
         </input>
         <output>
            <soap:body 
               encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; 
               namespace="HelloServer" use="encoded"/>
         </output>
      </operation>
   </binding>

   <service name="HelloServer">
      <port binding="serviceNS:HelloServerSoapBinding" name="HelloServerPort">
         <soap:address 
            location="http://localhost:8080/axis/services/HelloServer"/>
      </port>
   </service>

</definitions>

Reply via email to