Пример #1
0
 static void Main(string[] args)
 {
     try
     {
         OTA_HotelInvCountNotifRQ ota_HotelInvCountNotifRQ = new OTA_HotelInvCountNotifRQ();
         string envelope = File.ReadAllText(FILENAME);
         OTA_HotelInvCountNotifRQ serializedData = ota_HotelInvCountNotifRQ.DeserializeResXMl(envelope);
     }
     catch (Exception e)
     {
         string message    = e.Message;
         string stacktrace = e.StackTrace;
     }
 }
Пример #2
0
        public OTA_HotelInvCountNotifRQ DeserializeResXMl(string envelopeStr)
        {
            OTA_HotelInvCountNotifRQ ret = null;

            if (envelopeStr != null && envelopeStr != string.Empty)
            {
                try
                {
                    long          TimeStart = DateTime.Now.Ticks;
                    XmlSerializer serializer;
                    //serializer = new XmlSerializer(typeof(OTA_HotelInvCountNotifRQ));
                    serializer = new XmlSerializer(typeof(Envelope));
                    Envelope envelope = (Envelope)serializer.Deserialize(new StringReader(envelopeStr));
                    ret = envelope.body.ota_HotelInvCountNotifRQ;
                }
                catch (Exception e)
                {
                    ret = null;
                }
            }
            return(ret);
        }