public static AvailabilityResponse DeserializeAvailabilityResponse(Stream replyStream) { AvailabilityResponse availabilityResponse = null; XmlReader inreader = null; if (replyStream != null) { XmlSerializer xs = new XmlSerializer(typeof(AvailabilityResponse)); inreader = new XmlTextReader(replyStream); availabilityResponse = (AvailabilityResponse)xs.Deserialize(inreader); return(availabilityResponse); } else { return(null); } }
static void Main(string[] args) { Stream stream = File.Open(FILENAME, FileMode.Open); AvailabilityResponse availabilityResponse = DeserializeAvailabilityResponse(stream); }