Unable to parse the soap server response to appropriate Java Object Type
843833Sep 13 2006 — edited Sep 15 2006Hi,
My Customer's PERL server is generating the following response :
---[HTTP response 200]---
Keep-alive: timeout=15
Date: Thu, 14 Sep 2006 01:14:50 GMT
Content-length: 728
Content-type: text/xml; charset=utf-8
Connection: Keep-Alive
null: HTTP/1.1 200 OK
Soapserver: SOAP::Lite/Perl/0.69
Server: Apache
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:namesp1="http://namespaces.soaplite.com/perl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<pollDeviceByIDResponse xmlns="urn:ENIRA_Soap">
<pollDeviceParamOut xsi:type="namesp1:pollDeviceParamOut">
<integration_queue_id_seq xsi:type="xsd:int">
151
</integration_queue_id_seq>
<description xsi:type="xsd:string" />
<result xsi:type="xsd:string">
success
</result>
</pollDeviceParamOut>
</pollDeviceByIDResponse>
</soap:Body>
</soap:Envelope>
I use JAX-WS 2.0.1 libraries on the client side and I expected the above response to be parsed into a "PollDeviceParamOut" java bean object.
Here are the WSDL definitions that drive it :
+++ Type +++
<xsd:complexType name="pollDeviceParamOut">
<xsd:sequence>
<xsd:element name="result" type="xsd:string"/>
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="integration_queue_id_seq" type="xsd:integer"/>
</xsd:sequence>
</xsd:complexType>
+++ Message +++
<wsdl:message name="pollDeviceByIDResponse">
<wsdl:part name="pollDeviceByIDMessageResponse" type="xsd1:pollDeviceParamOut"/>
</wsdl:message>
+++ Operation +++
<wsdl:operation name="pollDeviceByID">
<wsdl:input message="tns:pollDeviceByIDRequest"/>
<wsdl:output message="tns:pollDeviceByIDResponse"/>
</wsdl:operation>
+++ WSImport +++
I used wsimport to generate the client side stubs from the WSDL.
The client side stub results in the PollDeviceParamOut.java file with the following contents :
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "pollDeviceParamOut", propOrder = {
"result",
"description",
"integrationQueueIdSeq"
})
public class PollDeviceParamOut {
@XmlElement(required = true)
protected String result;
@XmlElement(required = true)
protected String description;
@XmlElement(name = "integration_queue_id_seq", required = true)
protected BigInteger integrationQueueIdSeq;
/**
* Gets the value of the result property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getResult() {
return result;
}
/**
* Sets the value of the result property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setResult(String value) {
this.result = value;
}
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Gets the value of the integrationQueueIdSeq property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getIntegrationQueueIdSeq() {
return integrationQueueIdSeq;
}
/**
* Sets the value of the integrationQueueIdSeq property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setIntegrationQueueIdSeq(BigInteger value) {
this.integrationQueueIdSeq = value;
}
}
+++ Usage +++
I use the call as follows :
PollDeviceParamOut result = port.PollDeviceByID(deviceId);
And the result is always null. What is going wrong?