I am creating a framework that will integrate two applications, this piece of functionality will eventually sit as a web service between the two. Example:- if an invoice is generated in app 1 I want to be able to map it to the invoice fields for the app 2 db.... I have a custom type (invoice) that I wish to serialise and validate against a schema. I also have a server process that will post a string of xml into a database (app2 side) rather than go to the bother of creating an xml file and storing somewhere - then read it back in as a string, It would make it more straight forward if I could just create the string somehow with no IO overhead.
I guess I'm not understanding your question. Are you starting with a file, a string? If you are starting with a string of xml, then you already have a string. I think it would help to understand what you are trying to do.
David IsaacPosted Jun 14, 2007, 12:40 PM
Hi,
I am creating a framework that will integrate two applications, this piece of functionality will eventually sit as a web service between the two. Example:- if an invoice is generated in app 1 I want to be able to map it to the invoice fields for the app 2 db....
I have a custom type (invoice) that I wish to serialise and validate against a schema. I also have a server process that will post a string of xml into a database (app2 side) rather than go to the bother of creating an xml file and storing somewhere - then read it back in as a string, It would make it more straight forward if I could just create the string somehow with no IO overhead.
Mike GoldPosted Jun 14, 2007, 11:47 AM
I guess I'm not understanding your question. Are you starting with a file, a string? If you are starting with a string of xml, then you already have a string. I think it would help to understand what you are trying to do.
David IsaacPosted Jun 14, 2007, 4:16 AM
Mike GoldPosted Jun 13, 2007, 1:51 PM
Use the InnerXml Property to extract it into a string.
XmlDocument doc = new XmlDocument();
doc.Load(@"c:\myfile.xml");
string contents = doc.InnerXml;