Hi Massimiliano,

DOM does not explicitly add namespace declarations, you have to add them
yourself. So in your example:

envelope = impl.createDocument(namespace, "soapenv:Envelope", null);
Element envelopeElement = envelope.getDocumentElement();
envelope.setAttribute("xmlns:soapenv", namespace);

You should see the soapenv prefix declarared correctly then.

Colm.

-----Original Message-----
From: Massimiliano Masi [mailto:[email protected]] 
Sent: 04 May 2009 14:52
To: [email protected]
Subject: Localname of the securityHeader is set to null

Hi,

I don't know if it is a FAQ (in this case, sorry), but I've the
following problem.

I create a new Envelope like this:

  Document envelope = docBuilder.newDocument();
  DOMImplementation impl = docBuilder.getDOMImplementation();

  envelope =
impl.createDocument("http://www.w3.org/2003/05/soap-envelope";,

"soapenv:Envelope", null);
  Element envelopeElement = envelope.getDocumentElement();

 WSSecHeader wsseHeader = new WSSecHeader();
 wsseHeader.insertSecurityHeader(envelope);


the outcome is:

<soapenv:Header>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd"
xmlns:null="http://www.w3.org/2003/05/soap-envelope";
null:mustUnderstand="true"><wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssec
urity-utility-1.0.xsd"
wsu:Id="Timestamp-4047165"><wsu:Created>2009-05-04T13:48:06.335Z</wsu:Cr
eated><wsu:Expires>2009-05-04T13:58:06.335Z</wsu:Expires></wsu:Timestamp
></wsse:Security></soapenv:Header></soapenv:Envelope>


that is NOT correct:

xmlns:null="http://www.w3.org/2003/05/soap-envelope";
null:mustUnderstand="true"

null instead of soapenv. Am I wrong?

Thank you in advance,

      Massimiliano

-- 
Massimiliano Masi

http://www.mascanc.net/~max

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to