I'm relatively new to most of this stuff. 
 
Does anyone have any experience with the Java XML Security package and  .Net C# interopability?
 
I'm trying to get xml, canonicalized using the XML Security package in Java, to be canonicalized in the same way the .Net XmlDsigC14NWithCommentsTransform canonicalizes XML, or vice versa.  I need to do this for some custom signature stuff I need to do on the xml.
 
I can't seem to get the canonicalized xml to match up.  There appear to be issues with the namespaces.
 
With an example message of
 
<soap:Envelope
  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
  xmlns:xsd='http://www.w3.org/2001/XMLSchema'
  xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
  xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
  soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
  <soap:Body>
    <n:getRate xmlns:n='urn:xmethods-CurrencyExchange'>
      <country1 xsi:type='xsd:string'>usa</country1>
      <country2 xsi:type='xsd:string'>japan</country2>
    </n:getRate>
  </soap:Body>
 
  <!-- test comment -->
  <testElement c='3' b='2' a='1'>
   test crapola
   </testElement>
</soap:Envelope>
 
I'm using the Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS in java to produce
 
 
But using the XmlDsigC14NWithCommentsTransform in .Net C#  to produce
 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><soap:Body><n:getRate xmlns:n="urn:xmethods-CurrencyExchange"><country1 xsi:type="xsd:string">usa</country1><country2 xsi:type="xsd:string">japan</country2></n:getRate></soap:Body><!-- test comment --><testElement a="1" b="2" c="3">&#xD;
   test crapola&#xD;
   </testElement></soap:Envelope>
 
If anyone can help, I would appreciate it.
 
Thanks,
 
Skip
 
 

Reply via email to