aspose file tools*
The moose likes Web Services and the fly likes get Soap service return valus and EnvelopeString Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "get Soap service return valus and EnvelopeString" Watch "get Soap service return valus and EnvelopeString" New topic
Author

get Soap service return valus and EnvelopeString

KM Chen
Greenhorn

Joined: Nov 02, 2004
Posts: 5
Hi,

I am new in SOAP.

I have a simple code to get the return valus form service and get SOAP response Envelope data. But I need to call the service twice.

How can I get the both data and response Envelope string by only calling the service only once??


// part 1. get the return values
Response resp = call.invoke(new URL(serviceUrlString), ""); //(1)
Parameter retValue = resp.getReturnValue();
Object value = retValue.getValue();


// part 2. get SOAP response Envelope data
SOAPMappingRegistry smr = call.getSOAPMappingRegistry();
SOAPContext reqCtx = call.getSOAPContext();
Envelope callEnv = call.buildEnvelope();
SOAPHTTPConnection st = (SOAPHTTPConnection)call.getSOAPTransport();
st.send(new URL(serviceUrlString), "", null, null, smr,reqCtx); //(2)
String soapResponseStr = call.getEnvelopeString(st);



Thanks,
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
What kind of class is "Response"? Neither the J2EE 1.4 nor the Axis 1.2 docs have such a class. It's generally possible to obtain the SOAP envelope from the response of a WS call, though.


Ping & DNS - my free Android networking tools app
KM Chen
Greenhorn

Joined: Nov 02, 2004
Posts: 5
Thanks for your reply.

The Response class is apache.soap.rpc.Response.
Can you please advise me some code reagrding to get SOAP envelope from the response of a WS call?

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get Soap service return valus and EnvelopeString