M
MikeL
I need to get the XML doc from the deserialized type (seResults) returned
from a web service. Here's what I came up with - thanks in advance:
System.Xml.Serialization.XmlSerializer s = new
System.Xml.Serialization.XmlSerializer(typeof(seResults));
// First, get the size of the result XML doc and initialize the byte array:
Stream mm = new MemoryStream();
s.Serialize(mm, results);
byte[] byteArray = new byte[mm.Length];
mm = new MemoryStream(byteArray,0,(int)mm.Length);
// Now serialize the result:
s.Serialize(mm, results);
// Now convert it to a string:
ASCIIEncoding encoding = new ASCIIEncoding( );
string str = encoding.GetString(byteArray);
str = str.Trim();
MessageBox.Show(str);
from a web service. Here's what I came up with - thanks in advance:
System.Xml.Serialization.XmlSerializer s = new
System.Xml.Serialization.XmlSerializer(typeof(seResults));
// First, get the size of the result XML doc and initialize the byte array:
Stream mm = new MemoryStream();
s.Serialize(mm, results);
byte[] byteArray = new byte[mm.Length];
mm = new MemoryStream(byteArray,0,(int)mm.Length);
// Now serialize the result:
s.Serialize(mm, results);
// Now convert it to a string:
ASCIIEncoding encoding = new ASCIIEncoding( );
string str = encoding.GetString(byteArray);
str = str.Trim();
MessageBox.Show(str);