RPCMessageReceiver creates array response in wrong XML namespace
----------------------------------------------------------------

                 Key: AXIS2-1606
                 URL: http://issues.apache.org/jira/browse/AXIS2-1606
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Bug
    Affects Versions: nightly
         Environment: all environments
            Reporter: Robert Staerk


I get a SOAP response with the wrong XML namespace 
"http://org.apache.axis2/xsd"; for a method that returns an array of objects. 
The namespace "http://org.apache.axis2/xsd";, however is neither used in the 
project nor mentioned in the WSDL. In the example below, the namespace should 
be "http://service.mydomain.com/xsd";. I am using 
org.apache.axis2.rpc.receivers.RPCMessageReceiver.

SOAP response:

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv = "http://www.w3.org/2003/05/soap-envelope";>
    <soapenv:Header/>
    <soapenv:Body>
        <ns:sayHelloResponse xmlns:ns = "http://org.apache.axis2/xsd";>
            <ns:return>
                <ns:text>Hello,</ns:text>
            </ns:return>
            <ns:return>
                <ns:text>World!</ns:text>
            </ns:return>
        </ns:sayHelloResponse>
    </soapenv:Body>
</soapenv:Envelope>

Server.xml config:

<service name="Hello" scope="application">
        <description>
        The Hello web service.
        </description>
        
        <messageReceivers>
                <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only";
                        
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
                <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out";
                        
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
        </messageReceivers>
   
        <parameter name="ServiceClass" locked="false">
                com.mydomain.service.Hello
        </parameter>
</service>

Java classes:

package com.mydomain.service;

import java.rmi.RemoteException;

import com.mydomain.data.MyObject;

public class Hello {
        
        public MyObject[] sayHello() throws RemoteException {
                return new MyObject[] {
                        new MyObject("Hello,"),
                        new MyObject("World!")
                };
        }
        
}

package com.mydomain.data;

public class MyObject {
        private String text;
        
        public MyObject() {
                // empty
        }
        
        public MyObject(String text) {
                super();
                this.text = text;
        }

        public String getText() {
                return text;
        }

        public void setText(String text) {
                this.text = text;
        }
        
        
}

WSDL generated by org.apache.ws.java2wsdl.Java2WSDL:

<wsdl:definitions
    xmlns:axis2 = "http://service.mydomain.com";
    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:ns = "http://service.mydomain.com/xsd";
    xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/";
    xmlns:wsdl = "http://schemas.xmlsoap.org/wsdl/";
    targetNamespace = "http://service.mydomain.com";>
    <wsdl:types>
        <xs:schema
            xmlns:xs = "http://www.w3.org/2001/XMLSchema";
            xmlns:ax21 = "http://data.mydomain.com/xsd";
            attributeFormDefault = "qualified"
            elementFormDefault = "qualified"
            targetNamespace = "http://data.mydomain.com/xsd";>
            <xs:element name = "MyObject" type = "ax21:MyObject"/>
            <xs:complexType name = "MyObject">
                <xs:sequence>
                    <xs:element
                        name = "text"
                        nillable = "true"
                        type = "xs:string"/>
                </xs:sequence>
            </xs:complexType>
        </xs:schema>
        <xs:schema
            xmlns:xs = "http://www.w3.org/2001/XMLSchema";
            xmlns:ns0 = "http://data.mydomain.com/xsd";
            attributeFormDefault = "qualified"
            elementFormDefault = "qualified"
            targetNamespace = "http://service.mydomain.com/xsd";>
            <xs:element name = "sayHelloFault">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name = "sayHelloFault" type = "xs:anyType"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name = "sayHelloResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element
                            maxOccurs = "unbounded"
                            name = "return"
                            nillable = "true"
                            type = "ns0:MyObject"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name = "sayHelloMessage"/>
    <wsdl:message name = "sayHelloResponseMessage">
        <wsdl:part name = "part1" element = "ns:sayHelloResponse"/>
    </wsdl:message>
    <wsdl:message name = "sayHelloFault">
        <wsdl:part name = "part1" element = "ns:sayHelloFault"/>
    </wsdl:message>
    <wsdl:portType name = "HelloPortType">
        <wsdl:operation name = "sayHello">
            <wsdl:input message = "axis2:sayHelloMessage"/>
            <wsdl:output message = "axis2:sayHelloResponseMessage"/>
            <wsdl:fault message = "axis2:sayHelloFault" name = "sayHelloFault"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name = "HelloSOAP11Binding" type = "axis2:HelloPortType">
        <soap:binding transport = "http://schemas.xmlsoap.org/soap/http"; style 
= "document"/>
        <wsdl:operation name = "sayHello">
            <soap:operation soapAction = "urn:sayHello" style = "document"/>
            <wsdl:input>
                <soap:body use = "literal" namespace = 
"http://service.mydomain.com"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use = "literal" namespace = 
"http://service.mydomain.com"/>
            </wsdl:output>
            <wsdl:fault name = "sayHelloFault">
                <soap:body use = "literal" namespace = 
"http://service.mydomain.com"/>
            </wsdl:fault>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name = "HelloSOAP12Binding" type = "axis2:HelloPortType">
        <soap12:binding transport = "http://schemas.xmlsoap.org/soap/http"; 
style = "document"/>
        <wsdl:operation name = "sayHello">
            <soap12:operation soapAction = "urn:sayHello" style = "document"/>
            <wsdl:input>
                <soap12:body use = "literal" namespace = 
"http://service.mydomain.com"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use = "literal" namespace = 
"http://service.mydomain.com"/>
            </wsdl:output>
            <wsdl:fault name = "sayHelloFault">
                <soap12:body use = "literal" namespace = 
"http://service.mydomain.com"/>
            </wsdl:fault>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name = "Hello">
        <wsdl:port name = "HelloSOAP11port" binding = 
"axis2:HelloSOAP11Binding">
            <soap:address location = 
"http://localhost:8080/axis2/services/Hello"/>
        </wsdl:port>
        <wsdl:port name = "HelloSOAP12port" binding = 
"axis2:HelloSOAP12Binding">
            <soap12:address location = 
"http://localhost:8080/axis2/services/Hello"/>
        </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