Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Unable to parse the soap server response to appropriate Java Object Type

843833Sep 13 2006 — edited Sep 15 2006
Hi,

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?

Comments

L. Fernigrini

Consider using PL/Scope

PL/Scope Enhancements in Oracle Database 12c Release 2 (12.2) (0 Bytes)It is simpler than parsing code.

User_RI4C6

How its work I admit that I am a beginner in the world of plsql and I told myself that it is possible to do it with regexp

User_H3J7U

it can be for example standard package, ULT_HTTP
UTL_HTTP Constants

L. Fernigrini

undefined (0 Bytes)You need to set some session settings like this:

ALTER SESSION SET PLSCOPE_SETTINGS='IDENTIFIERS:ALL, STATEMENTS:ALL';

Then compile the package, and then query the dictionary tables being populated when you compile PL/SQL and have set PLSCOPE settings.
In the article I mentioned there is an example :
image.pnghere you would see that variable L_NUM and L_STR are declared on lunes 6 and 7, and that they reference the NUMBER and CHARACTER datatypes. You can modify the query in the example to filter only "VARIABLE" as TYPE; "DECLARATION" as USAGE and then get the associated REFERENCE row to get the datatype.

L. Fernigrini

Poster mentioned ANY package, documentation exists only for Oracle provided packages.

User_RI4C6

Wow very cool, Thank you very much for the help.!

1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 13 2006
Added on Sep 13 2006
2 comments
314 views