namespace uri not set in the SOAP response

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

namespace uri not set in the SOAP response

chin
Hi,

I am trying to create webservice in Axis1. And the sample WSDL is as follow

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:http.service.messageboard.ca.liferay.com" xmlns:intf="urn:http.service.messageboard.ca.liferay.com" xmlns:tns1="http://model.messageboard.ca.liferay.com" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:http.service.messageboard.ca.liferay.com">
       
        <wsdl:types>
                <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://model.messageboard.ca.liferay.com">
                        <complexType name="MBIdeasMessageVO">
                                <sequence>
                                        <element name="messageId" type="xsd:long"/>
                                        <element name="url" nillable="true" type="xsd:string"/>
                                </sequence>
                        </complexType>
                        <complexType name="MBIdeasMessageResponseVO">
                                <sequence>
                                        <element name="flag" type="xsd:boolean"/>
                                </sequence>
                        </complexType>
                </schema>
                <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:http.service.messageboard.ca.liferay.com">
                        <import namespace="http://model.messageboard.ca.liferay.com"/>
                        <element name="mbIdeasMessage" type="tns1:MBIdeasMessageVO"/>
                        <element name="associateUrlToMessageReturn" type="tns1:MBIdeasMessageResponseVO"/>
                </schema>
        </wsdl:types>
        <wsdl:message name="associateUrlToMessageResponse">
                <wsdl:part element="impl:associateUrlToMessageReturn" name="associateUrlToMessageReturn"/>
        </wsdl:message>
        <wsdl:message name="associateUrlToMessageRequest">
                <wsdl:part element="impl:mbIdeasMessage" name="mbIdeasMessage"/>
        </wsdl:message>
        <wsdl:portType name="MBIdeasDetailServiceSoap">
                <wsdl:operation name="associateUrlToMessage" parameterOrder="mbIdeasMessage">
                        <wsdl:input message="impl:associateUrlToMessageRequest" name="associateUrlToMessageRequest"/>
                        <wsdl:output message="impl:associateUrlToMessageResponse" name="associateUrlToMessageResponse"/>
                </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="Portlet_ca_MBIdeasDetailServiceSoapBinding" type="impl:MBIdeasDetailServiceSoap">
                <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
                <wsdl:operation name="associateUrlToMessage">
                        <wsdlsoap:operation soapAction=""/>
                        <wsdl:input name="associateUrlToMessageRequest">
                                <wsdlsoap:body use="literal"/>
                        </wsdl:input>
                        <wsdl:output name="associateUrlToMessageResponse">
                                <wsdlsoap:body use="literal"/>
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="MBIdeasDetailServiceSoapService">
                <wsdl:port binding="impl:Portlet_ca_MBIdeasDetailServiceSoapBinding" name="Portlet_ca_MBIdeasDetailService">
                        <wsdlsoap:address location="http://localhost:8080/tunnel-web/axis/Portlet_ca_MBIdeasDetailService"/>
                </wsdl:port>
        </wsdl:service>
</wsdl:definitions>


Now when i try to invoke this webservice using Axis2 client, the SOAP Response return has empty namespace uri.

The client code is

                MBIdeasDetailServiceSoapServiceStub stub = new MBIdeasDetailServiceSoapServiceStub("http://localhost:9090/tunnel-web/axis/Portlet_ca_MBIdeasDetailService");
               
                MsgObj msg = new MBIdeasDetailServiceSoapServiceStub.MsgObj();
               
                MBIdeasMessageVO msgVo = new MBIdeasDetailServiceSoapServiceStub.MBIdeasMessageVO();
                msgVo.setMessageId(10801l);
                msgVo.setUrl("http://localgoogle.com");
                msg.setMsgObj(msgVo);
               
                AssociateUrlToMessageReturn retn = stub.associateUrlToMessage(msg);
                System.out.println("Processing end ");


The SOAP message log is

POST /tunnel-web/axis/Portlet_ca_MBIdeasDetailService HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:http.service.messageboard.ca.liferay.com:MBIdeasDetailServiceSoap:associateUrlToMessageRequest"
User-Agent: Axis2
Host: 127.0.0.1:9090
Transfer-Encoding: chunked

141
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns2:mbIdeasMessage xmlns:ns2="urn:http.service.messageboard.ca.liferay.com"><messageId>10801</messageId><url>http://localgoogle.com</url></ns2:mbIdeasMessage></soapenv:Body></soapenv:Envelope>
0

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=62B12C0E782A5675F97774741E51D454; Path=/tunnel-web
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Mon, 18 Oct 2010 13:16:52 GMT

15a
<?xml version="1.0" encoding="UTF-8"?><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><associateUrlToMessageReturn xmlns=""><flag>true</flag></associateUrlToMessageReturn></soapenv:Body></soapenv:Envelope>

And at the end i my getting below expection on the client side because to empty namepsace uri.

org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement associateUrlToMessageReturn
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)


Any help on this regard will be very helpfull.