Skip to Main Content

Java Development Tools

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!

Newbie Q: How show SOAP request from web service proxy stub (JDev 10.1.3.1)

117240Sep 20 2006 — edited Jan 22 2007
Hello,
Sorry if this question seems silly, but I'm new to Web Services and not especially skilled at Java either.

I'm trying to System.out.println the SOAP request just before calling a web service.
What's the simplest way of doing that?
I would like to see something like the following in the log window:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
etc...<soap:Body>
<Call xmlns:T2api="urn:/T2api/Proto/Soap" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<url xsi:type="xsd:string">HWP/access</url>
</Call>
</soap:Body>
</soap:Envelope>

The web service proxy has been automagically generated by Jdeveloper and is working excellent. (This is the Stub code, not the Client)
/*
* implementation of call
*/
public call_cap.proxy.types.t2api.proto.soap.Response call(call_cap.proxy.types.t2api.proto.soap.Request request)
throws java.rmi.RemoteException {

StreamingSenderState _state = null;
try {

state = start(_handlerChain);
if (_getProperty(ClientConstants.DIME_ENCODE_MESSAGES_WITH_ATTACHMENTS) != null) {
state.getMessageContext().getMessage().setProperty("DimeEncode",getProperty(ClientConstants.DIME_ENCODE_MESSAGES_WITH_ATTACHMENTS));
}

InternalSOAPMessage request = state.getRequest();
request.setOperationCode(CallOPCODE);
_state.getMessageContext().setProperty("oracle.j2ee.ws.mgmt.interceptor.operation-qname",new QName("","Call"));

call_cap.proxy.types.t2api.proto.soap.Call myCall = new callcap.proxy.types.t2api.proto.soap.Call();
_myCall.setRequest(request);

SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns1Call_Call_QNAME);
bodyBlock.setValue(myCall);
bodyBlock.setSerializer(myns1Call__Call_LiteralSerializer);
request.setBody(bodyBlock);

_state.getMessageContext().setProperty("http.soap.action", "");
//
// My guess is that it is here I should print the request to stdout. But how???
//
send((String) getProperty(ENDPOINT_ADDRESS_PROPERTY), _state);

call_cap.proxy.types.t2api.proto.soap.Response _result = null;
Object responseObj = state.getResponse().getBody().getValue();
if (_responseObj instanceof SOAPDeserializationState) {
result = (callcap.proxy.types.t2api.proto.soap.Response)((SOAPDeserializationState) _responseObj).getInstance();
} else {
result = (callcap.proxy.types.t2api.proto.soap.Response)_responseObj;
}

return _result;

} ... exception handling
}
--- If anyone wonders why I want the request output it's because I need to implement the web service call in PL/SQL instead and I can't get it to work.

Thanks for any help!
/Josefine
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 19 2007
Added on Sep 20 2006
1 comment
971 views