Re: Add Header tp SOAP with SOAPElement API

From: manoj cheenath <manojc_at_BEA.COM>
Date: Wed, 19 Jun 2002 11:27:14 -0700

Try this:

SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
SOAPElement header = envelope.getHeader();

  envelope.createName( "Signature", "ds",
"") );

I never tried this on RI, but this works on weblogic JAX-RPC implementation.


----- Original Message -----
From: <yawningrascal_at_HOTMAIL.COM>
Sent: Wednesday, June 19, 2002 3:54 AM
Subject: Add Header tp SOAP with SOAPElement API

> Hi,
> I created a JAX-RPC Service and now I want to add Metadata to the SOAP
> concerning digital signatures. For that reason I created a
> to intercept the SOAP Message. At this point I want to use the SOAPElement
API to add my own header to the Message. First I inspected the SOAP Message
> with a TCP/IP Tool and were no headers in my SOAP Requests. (How can I
> JAX-RPC to add an empty standard header to a soap message?). So I tried
the following with my handler:
> Name nsSignature =
> se.getHeader().detachNode();
> SOAPHeader sh = se.addHeader();
> sh.addHeaderElement(nsSignature);
> Unfortunately no header appeared in the soap message.
> Anyone out there who knows how this could work?
> Thanx, Mischa