Dhanush Gopinath wrote:
Hi There
At the client side u can instatiate a Stub Object from the org.apache.axis.client and use
a method setHeader() to set the Header of an out going SOAP Message, I mean request Message.
At the server side do this :
* MessageContext msgContext = MessageContext.getCurrentContext();
Message reqMsg = msgContext.getRequestMessage(); // Gets the SOAPNevelope for the Request Message SOAPEnvelope soapEnv= reqMsg.getSOAPEnvelope();
// Gets the SOAPHeader for the Request Message
SOAPHeader soapHead= (org.apache.axis.message.SOAPHeader)soapEnv.getHeader();
// Gets all the SOAPHeaderElements into an Iterator
Iterator itrElements= soapHead.getChildElements();*
Iterate through this iterator to extract each Child element of the Header.
Yes, I am able to extract the data from an incoming SOAPEnvelope, but I was wondering what is the easiest/right way to input the data back to another SOAPEnvelope, when I have the Header and Body parts as Strings (in a database). I need to do it at the server-side, so the client methods are not available.
Hello,
I would like to have some advices / comments about populating SOAPHeader and SOAPBody of a SOAPEnvelope (org.apache.axis.message.*).
I have a web service that receives a SOAPEnvelope, and saves its SOAPHeader and SOAPBody parts to a database (as String). At a later time, when another SOAP-request comes in, the web service gets the String-values from database, and populates the SOAPEnvelope with them.
I am wondering, what is the easiest/best/right way to populate the
SOAPHeader and SOAPBody of the SOAPEnvelope when they are already represented as Strings?
For example, if the SOAPHeader-part is saved as following in the database, how should I insert it to a SOAPEnvelope?
<SOAP-ENV:Header> <ar:MessageHeader SOAP-ENV:mustUnderstand="1"> <ar:From> <ar:PartyId>ID 1</ar:PartyId> <ar:Role>requester</ar:Role> </ar:From> <ar:To> <ar:PartyId>ID 1</ar:PartyId> <ar:Role>responder</ar:Role> </ar:To> </ar:MessageHeader SOAP-ENV:mustUnderstand="1"> </SOAP-ENV:Header>
~ Ilari Kontinen