Re-Serializing InfoPath file after having DeSerialized it - InfoPath Dev
in

InfoPath Dev

Re-Serializing InfoPath file after having DeSerialized it

Last post 06-26-2009 11:47 AM by SusanH. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 06-26-2009 11:47 AM

    • SusanH
    • Not Ranked
    • Joined on 10-30-2007
    • Posts 3

    Re-Serializing InfoPath file after having DeSerialized it

    I am having a problem re-serializing my information back into InfoPath. 

    I have serialized out the form by first using xsd.exe to get the classes for the mySchema.xsd file created by InfoPath.  I have marked the anyAttrField as [System.NonSerialized] and I deserialize infopath using the following:

    XmlSerializer serializer = new XmlSerializer(typeof(MyClass));
    using (Stream documentStream = infoPathFormDocument.OpenBinaryStream())
    {
        _infoPathData = (
    MyClass)serializer.Deserialize(documentStream);
    }

    Once I make changes to the object, I want to serialize it back in.  I have tried first saving out the processing instructions and then putting them back in; my form now gets all of the correct values if you open the form, however all of my promoted fields are completely blank!   If I just go through an XMLDocument and update the values using XPath, everything is fine.  So I'm thinking that it has to do with the format of the class or how it re-serializes it.

    Has anyone successfully re-serialized the document back in to InfoPath after changing the object?

    Thanks
    Sue H

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