Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get Soap service return valus and EnvelopeString

 
KM Chen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
KM Chen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic