I have a web service which returns a string representing an Xml file. The string is properly formed xml. I need to create FileInfo object from the string so that I can deserialize it.
I don't have the file path or even if i do thats of no use as it is a disconnected server.
I can convert string to XmlDocument by -
XmlDocument doc = new XmlDocument();
doc.LoadXml(MyString);
How do I get FileInfo so that I can deserialize it? Please help.
Solution:
Thanks for your replies. I created XmlReader from the string returned by the service and used XmlSerializer.Deserialize to get the object I needed.
using (XmlReader tr = XmlReader.Create(new StringReader(mystring)))
{
XmlSerializer serializer = new XmlSerializer(typeof(<T>), extraTypes);
<T> serizalizedForm = serializer.Deserialize(tr) as <T>;
}