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=22336>.
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=22336

Wrong namespace specified for SOAP response 

           Summary: Wrong namespace specified for SOAP response
           Product: Axis
           Version: 1.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I've written a Axis server that simply adds two numbers together. The class
looks like

public class Math
{
    public double add(double d1, double d2)
    {
        return d1 + d2;
    }
}

The WSDD looks like this

<deployment xmlns="http://xml.apache.org/axis/wsdd/";  
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
    <service name="math" provider="java:RPC" style="wrapped"> 
        <parameter name="className" value="com.develop.kevinj.Math"/>
        <parameter name="allowedMethods" value="*"/> 
    </service> 
</deployment>


This deploys fine and I can write an Axis client that reads the generated WSDL
and works. However if I create a JAX-RPC client then I get an error

"java.rmi.RemoteException: Runtime exception; nested exception is: 
        unexpected element name: expected=addReturn,
actual={http://kevinj.develop.com}addReturn
..."

The SOAP request looks like this
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:ns0="http://kevinj.develop.com";>
  <env:Body>
    <ns0:add><d1>23.32</d1><d2>45.56</d2></ns0:add>
  </env:Body>
</env:Envelope>

(add is in ns0, d1 and d2 are in no namespace)

the response looks like this

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
 <soapenv:Body>
  <addResponse xmlns="http://kevinj.develop.com";>
   <addReturn xsi:type="xsd:double">68.88</addReturn>
  </addResponse>
 </soapenv:Body>
</soapenv:Envelope>

both addResponse and addReturn are in the default (http://kevinj.develop.com)
namespace. The generated WSDL contains a schema that looks like this

<schema targetNamespace="http://kevinj.develop.com";
xmlns="http://www.w3.org/2001/XMLSchema";>
  <element name="add">
     <complexType>
       <sequence>
         <element name="d1" type="xsd:double"/>
         <element name="d2" type="xsd:double"/>
       </sequence>
     </complexType>
   </element>
   <element name="addResponse">
     <complexType>
        <sequence>
          <element name="addReturn" type="xsd:double"/>
        </sequence>
     </complexType>
   </element>
</schema>

This means that the request is correct and the response is wrong - addReturn
should be in no namepsace

Either I'm being stupid (which is highly likely) or this is a major error.

Reply via email to