In my project I suppose to write a desktop app that sends an xml document as file or as string,
to a php script on server that need to parse it.
Right now, I have php script that parse the xml, and have the xml ready at the desktop app.
My questions are:
a. which way is better: to send the document as file, or as string?
b. How to implement the request (file or string) by C#, and the acception of the document by php.
Notes:
a. I can use only C# at the desktop application.
b. I can use only php script on the server.
c. I use System.xml.linq to handle the xml document at the desktop app.
Thanks a lot!
This can be as simple or as complex as you like 😉
Here’s a very simple, basic example (without error handling et al):
and as “receiver”:
afterwards the file test.dat on the server contains
see also:
XElement.Save Method (Stream)
WebRequest.GetRequestStream Method
http://docs.php.net/wrappers.php.php