DOMWriter namespace writeNode() namespace reorganising

Please post support and help requests here.
Posts: 3
Joined: 18 Nov 2009, 16:12

DOMWriter namespace writeNode() namespace reorganising

Postby cashnl » 18 Nov 2009, 16:29


I'm using Poco libraries for communicating with a webservice. The webservice requires me to sign the SOAP message with WS-S specifications.
I've implemented the required elements for my webservice. However the generated SignatureValue and DigestValue aren't being accepted.

After some debugging regarding the SignatureValue I've found out that when I use

Code: Select all

Poco::XML::DOMWriter writer;
writer.writeNode(transformedContent, signedInfo);

All of the namespaces from element 'signedInfo' it's parent nodes that are used in 'signedInfo' or one of its children are being transeffered over from parent elements into 'signedInfo' element. Furthermore, the name of the namespace also changed

So the following original XML:

Code: Select all

  <ns4:CanonicalizationMethod Algorithm="" />
  <ns4:SignatureMethod Algorithm="" />
  <ns4:Reference URI="#Body">
      <ns4:Transform Algorithm="" />
    <ns4:DigestMethod Algorithm="" />


Code: Select all

<ns1:SignedInfo xmlns:ns1="">
  <ns1:CanonicalizationMethod Algorithm="" />
  <ns1:SignatureMethod Algorithm="" />
  <ns1:Reference URI="#Body">
      <ns1:Transform Algorithm="" />
    <ns1:DigestMethod Algorithm="" />

Normally this is the desired behaviour. But not in my case, since I want the original XML chunk unmodified so I can hash it with SHA1 and than encrypt it with RSA and finally encode it with Base64.

I'm really missing an innerHTML attribute. Something similiar like innerText attribute. Anyway I'd like to know if it's possible to output unmodifed XML with DOMWriter/XMLWriter. Otherwise Ill have to do ugly stuff like write the entire DOM to a file, and than only read out the SignedInfo element.

Thanks in Advance

Return to “Support”

Who is online

Users browsing this forum: No registered users and 2 guests