Hi Kang,

You can call the method *response.getBuilder().getDocumentElement() *to retrieve the entire soap envelope and this will contain the soap headers of the response.

********************************************************************************

       ServiceClient client = new ServiceClient();
       Options opts = new Options();
opts.setTo(new EndpointReference("http://localhost:8080/axis2/services/Adding";));
       opts.setAction("urn:addition"); //Replace this with your own action
       client.setOptions(opts);
       client.engageModule(qname);
       OMElement res = client.sendReceive(createPayLoad());
System.out.println(res.getBuilder().getDocumentElement()); //Prints the entire soap response

********************************************************************************

So you will get the entire soap envelope as below along with the soap headers.


<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing"; xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
   <soapenv:Header>
           <wsa:Action>urn:adding</wsa:Action>
<wsa:RelatesTo>urn:uuid:6F297A15C5BEC876271175572342300</wsa:RelatesTo>
   </soapenv:Header>
   <soapenv:Body>
           <ns:addingResponse xmlns:ns="http://add.math.com/xsd";>
                   <ns:return>10</ns:return>
           </ns:addingResponse>
       </soapenv:Body>
</soapenv:Envelope>

I hope this solves your problem.


Thanks,
Evanthika

Kang, Kamaljeet K. wrote:
Hi,

I am trying to retrieve soap header of the response from stub using
serviceClient.getLastOperationContext() but OperationContext is always
null.
Is this the right way to retrieve soap header in stub?

Thanks

Kamal
============================================================
The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader
of this message is not the intended recipient, or an employee
or agent responsible for delivering this message to the
intended recipient, you are hereby notified that any reproduction,
dissemination or distribution of this communication is strictly
prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and
deleting it from your computer. Thank you. Tellabs
============================================================

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Reply via email to