static void Main(string[] args) { IATA_PassengerConformanceIdentifyRQ localIataReq = new IATA_PassengerConformanceIdentifyRQ(); XmlSerializer deserializer = new XmlSerializer(localIataReq.GetType()); StreamReader reader = new StreamReader(FILENAME); XmlRootAttribute xRoot = new XmlRootAttribute(); xRoot.ElementName = "IATA_PassengerConformanceIdentifyRQ"; xRoot.IsNullable = false; localIataReq = (IATA_PassengerConformanceIdentifyRQ)deserializer.Deserialize(reader); reader.Close(); }
static void Main(string[] args) { IATA_PassengerConformanceIdentifyRQ localIataReq = new IATA_PassengerConformanceIdentifyRQ(); XmlSerializer deserializer = new XmlSerializer(localIataReq.GetType()); StreamReader reader = new StreamReader(FILENAME); XmlRootAttribute xRoot = new XmlRootAttribute(); xRoot.ElementName = "IATA_PassengerConformanceIdentifyRQ"; xRoot.IsNullable = false; localIataReq = (IATA_PassengerConformanceIdentifyRQ)deserializer.Deserialize(reader); reader.Close(); XmlSerializer serializer = new XmlSerializer(typeof(IATA_PassengerConformanceIdentifyRQ)); StreamWriter writer = new StreamWriter(@"c:\temp\test1.xml"); serializer.Serialize(writer, localIataReq); writer.Flush(); writer.Close(); writer.Dispose(); }