Hi,
 
I'm sorry to ask this question again. But I just would like to know if SOAP Apache is
 supporting insertion of block headers into the envelope.
I think I've done the right things in my code: first create a Header and populate it with a Vector, then attach it to the envelope via the instruction envelope.setHeader(header), but I can't check it.
 
Thanks a lot for your response,
Regards,
Cyril.
_______________________________
 
----- Original Message -----
Sent: Tuesday, November 19, 2002 12:01 PM
Subject: SOAP Apache 2.2 and header blocks.

Hi,

 

I have problem to set a Header into a SOAP Message with Apache SOAP 2.2

Here's the code to add a header to my message, but unfortunately, it doesn't seem to work.

When I look at the message by example through TunnelGui, I can't see my header.

Does Apache support the Header blocks or not?

Thanks a lot for your help,

Regards,

Cyril.

 

// create a vector for collecting the header elements

Vector headerElements = new Vector();

// Create a header element in a namespace

org.w3c.dom.Element headerElement =

doc.createElementNS(URI,"jaws:MessageHeader");

headerElement.setAttributeNS(URI,"SOAP-ENV:mustUnderstand","1");

// Create subnodes within the MessageHeader

org.w3c.dom.Element ele = doc.createElement("From");

org.w3c.dom.Text textNode = doc.createTextNode("Me");

org.w3c.dom.Node tempNode = ele.appendChild(textNode);

tempNode = headerElement.appendChild(ele);

ele = doc.createElement("To");

textNode = doc.createTextNode("You");

tempNode = ele.appendChild(textNode);

tempNode = headerElement.appendChild(ele);

ele = doc.createElement("MessageId");

textNode = doc.createTextNode("9999");

tempNode = ele.appendChild(textNode);

tempNode = headerElement.appendChild(ele);

headerElements.add(headerElement);

//Create the SOAP envelope

org.apache.soap.Envelope envelope = new org.apache.soap.Envelope();

//Add the SOAP header element to the envelope

org.apache.soap.Header header = new org.apache.soap.Header();

header.setHeaderEntries(headerElements);

envelope.setHeader(header);

_______________________________
 

Reply via email to