Skip to main content

JAX-WS returns response object empty

No replies
HugoTheVolunteer
Offline
Joined: 2013-05-06
Points: 0

Hello,

I am using JAX-WS RI 2.1.6 in JDK 6 to create soap webservice client.

Here is wsdl:

 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
   <wsdl:definitions name="customerSearch" targetNamespace="http://customer-search-gui.ws.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://customer-search-gui.ws.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://customer-search-gui.ws.com">
   <wsdl:types>
    <xsd:schema targetNamespace="http://customer-search-gui.ws.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:element name="STATUS">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="STATUS_CODE" type="xsd:integer"/>
                    <xsd:element name="ERROR_CODE" type="xsd:string" minOccurs="0"/>
                    <xsd:element name="ERROR_DESCRIPTION" type="xsd:string" minOccurs="0"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="customer">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="firstName" type="xsd:string" nillable="true"/>
                    <xsd:element name="lastName" type="xsd:string" nillable="true"/>
                    <xsd:element name="street" type="xsd:string" nillable="true"/>
                    <xsd:element name="number" type="xsd:string" nillable="true"/>
                    <xsd:element name="city" type="xsd:string" nillable="true"/>
                    <xsd:element name="zipCode" type="xsd:string" nillable="true"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>

        <xsd:element name="customerSearchCRMRequest">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="searchCriteria">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="firstName" minOccurs="0" type="xsd:string"/>
                                <xsd:element name="lastName" minOccurs="0" type="xsd:string"/>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                    <xsd:element name="trackingId" type="xsd:string"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="customerSearchCRMResponse">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="customerList">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element ref="tns:customer" maxOccurs="unbounded" minOccurs="0"/>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                    <xsd:element name="trackingId" type="xsd:string"/>
                    <xsd:element ref="tns:STATUS"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>        
    </xsd:schema>
</wsdl:types>
<wsdl:message name="searchCrmRequest">
    <wsdl:part name="request" element="tns:customerSearchCRMRequest"/>
</wsdl:message>
<wsdl:message name="searchCrmResponse">
    <wsdl:part name="response" element="tns:customerSearchCRMResponse"/>
</wsdl:message>
<wsdl:portType name="search">
    <wsdl:operation name="searchCrm">
        <wsdl:input message="tns:searchCrmRequest"/>
        <wsdl:output message="tns:searchCrmResponse"/>
    </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="searchSOAP" type="tns:search">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="searchCrm">
        <soap:operation soapAction="/searchCrm"/>
        <wsdl:input>
            <soap:body use="literal" namespace="http://customer-search-gui.ws.com"/>
        </wsdl:input>
        <wsdl:output>
            <soap:body use="literal" namespace="http://customer-search-gui.ws.com"/>
        </wsdl:output>
    </wsdl:operation>
</wsdl:binding>
<wsdl:service name="customerSearch">
    <wsdl:port binding="tns:searchSOAP" name="searchSOAP">
        <soap:address location="http://192.192.192.192:10001/customSearch"/>
    </wsdl:port>
</wsdl:service>

Request:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:customerSearchCRMRequest xmlns:ns2="http://customer-search-gui.ws.com"><searchCriteria><firstName>John</firstName></searchCriteria><trackingId>track001</trackingId></ns2:customerSearchCRMRequest></S:Body></S:Envelope>

Response:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><customerSearchCRMResponse xmlns="http://customer-search-gui.ws.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><customerList><customer><firstName>John</firstName><lastName>Stone</lastName></customer></customerList><trackingId>track001</trackingId><STATUS><STATUS_CODE>0</STATUS_CODE></STATUS></customerSearchCRMResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

So, like you can see there is something in response. But the problem is in java object customerSearchCRMResponse is contains no value (everything is null)!

But why, there is a response ?

And there is no error or exception throwns. Everything seems fine.

When I tried SOAP UI, everything works clear.

There is obvious problem in deserializing response.

But what can I do with that?

What and where is the problem?

Thank you