read write InfoPath with XmlDocument - InfoPath Dev
in

InfoPath Dev

read write InfoPath with XmlDocument

Last post 06-03-2008 11:28 AM by AntonM. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 06-03-2008 11:28 AM

    • AntonM
    • Not Ranked
    • Joined on 04-17-2008
    • Posts 3

    read write InfoPath with XmlDocument

     

    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

     

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.