public ILexusOut Invoke(ILexusIn lexusIn, Type outType) { //Debug.Assert(...); string xml = In2Xml(lexusIn); string returnXml = PostXmlToUrl(xml, lexusIn.url); return(Xml2Out(returnXml, outType)); }
private string In2Xml(ILexusIn lexusIn) { MemoryStream Stream = new MemoryStream(); XmlSerializer xs = new XmlSerializer(lexusIn.GetType()); xs.Serialize(Stream, lexusIn); Stream.Position = 0; StreamReader sr = new StreamReader(Stream); string xml = sr.ReadToEnd(); sr.Dispose(); Stream.Dispose(); return(xml); }