You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by Maarten Coene <Ma...@ToughGuy.net> on 2000/11/24 15:26:54 UTC

SOAP Headers

Hi,

what is the easiest way to create the following SOAP header using Apache SOAP.

<SOAP-ENV:Header>
         <t:Transaction xmlns:t="some-URI">5</t:Transaction>
</SOAP-ENV:Header>

I could make the above without the namespace declaration, but I don't find 
a way to create it with the namespace declaration. Even though my code 
works, I think there must be an easier way of doing this. My code for 
creating the above header without the namespaces looks like this:

Call call = new Call();
Header header = new Header();

Vector entries = new Vector();
DocumentImpl doc = new DocumentImpl();
ElementNSImpl entry = new ElementNSImpl(doc, "Transaction");
TextImpl entrydata = new TextImpl(doc, "5");
entry.appendChild(entrydata);
entries.addElement(entry);
header.setHeaderEntries(entries);

call.setHeader(header);

thx

Maarten



--
Maarten Coene
K.U.Leuven
Dept. Computerwetenschappen             Tel: ++32 (0)16/32 78 25
Celestijnenlaan 200A
B-3001 Heverlee