Send end:
Xmldsturl: URL to send
Xmlcontent: Sending Content
Try
{
HttpWebRequest myrequest = (HttpWebRequest) webrequest.create (xmldsturl);
byte[] requestcontent = System.Text.Encoding.ASCII.GetBytes (xmlcontent);
Myrequest.method = "POST";
Myrequest.contenttype = "Text/xml";
Myrequest.contentlength = requestcontent.length;
System.IO.Stream requeststream = Myrequest.getrequeststream ();
requestStream.Write (requestcontent, 0, requestcontent.length);
Requeststream.close ();
Issuccess = true;
}
catch (System.Exception ex)
{
issuccess = false;
}
Receiving end:
if (Request.InputStream.Length > 0) {byte[] bytes = new Byte[request.inputstream.leng
TH]; Request.InputStream.Read (bytes, 0, bytes.
Length);
FileStream fs = new FileStream (Request.physicalapplicationpath + "File.txt", FileMode.Create); Fs. Write (bytes, 0, bytes.
Length); Fs.
Flush (); Fs.
Close (); }