Hi All,
I try to read and save an InfoPath document which is signed with a digital signature.
We use InfoPath 2003 SP3.
Here some code I tried:
1.
string xmlContent = File.ReadAllText("sample.xml");
File.WriteAllText("sample_2.xml", );
Works fine!
2.
XmlDocument xdoc = new XmlDocument();
string xmlContent = File.ReadAllText("sample.xml"); xdoc.LoadXml(xmlContent);
File.WriteAllText("sample_2.xml", xdoc.OuterXml);
When I open the sample_2.xml I get an error that sounds like that (translated from German):
All or one signature could not be verified...
I tried some other Writer classes like StringWriter, XmlTextWriter or StreamWriter, but I get always the same error.
I think it is an encoding issue. So if I compare these two files with winDiff, there are many differences.
Could someone tell me please how to write a valid InfoPath xml document without have impact on the existing signatures. Which Encoding uses the OuterXML property?
Thanks a lot,
Anton