[xml] Question regarding xmlAddId


I'm having some problems using xmlAddId. My problem is that I need to sign documents
using XMLSEC and the wsu:Id-attribute (in soap:Body below) cannot be found by 
xpointer unless I add a DTD. I have been told however that one should not (may not?) 
use a DTD in SOAP documents and that is the reason why I want to use xmlAddId. 
Below is the XML that I try to sign but I haven't been able to find a call to xmlAddId 
that will work. The DTD look like this:

<!DOCTYPE soap:Envelope [

What should I use for xmlAttrPtr and what should I use for "value" to xmlAddId in order
to replace the DTD? I have tried every combination that I could think of. 
Another strange thing is that apparently I have to reload the whole tree before 
xpointer will "see" the wsu:Id attribute. I think this is because I build the whole
tree in code and there is a problem (bug?) in XMLLIB regarding DTD's. 

Thanks for your help,

Erik F. Andersen

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; 
  <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"; 
   <Signature xmlns="http://www.w3.org/2000/09/xmldsig#";>
      <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> 
      <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> 
       <Reference URI="#Id-058b5a86-a1dd-4188-9920-8315c3f84eae">
         <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> 
        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"; /> 
        <DigestValue /> 
  <soap:Body xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility";

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]