>
Can you provide code sample, where you "send large database files"?
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
on the client: ( the xml is stored in "message")
{HttpWebRequest req =
(HttpWebRequest)HttpWebRequest.Create(Configuratio nManager.AppSettings["uri"]);
req.ContentType = "text/xml; charset=utf-8";
req.Method = "POST";
UTF8Encoding encoding = new UTF8Encoding();
byte[] postBytes = encoding.GetBytes(message);
req.ContentLength = postBytes.Length;
System.IO.Stream reqStream = req.GetRequestStream();
reqStream.Write(postBytes, 0, postBytes.Length);
reqStream.Close();
req.Timeout = 1000*int.Parse(
ConfigurationManager.AppSettings["SessionTimeOut"].ToString());
//SessionTimeOut
Log.Write("Sending file:" +
ConfigurationManager.AppSettings[file].ToString());
System.Net.WebResponse resp = (HttpWebResponse)req.GetResponse();
System.IO.StreamReader sr = new
System.IO.StreamReader(resp.GetResponseStream());
message = (sr.ReadToEnd().Trim()).ToString();
Log.Write("Received response of file:" +
ConfigurationManager.AppSettings[file].ToString());
postBytes = encoding.GetBytes(message);
System.IO.File.WriteAllBytes(numb.ToString() + "received.xml", postBytes);
resp.Close();
sr.Close();
On the server:( the server is an xml gateway built as an http handler that
use ODP.NET to intrect with some oracle backend)
public void ProcessRequest (HttpContext context) {
try
{
DataAccess da = new DataAccess();
context.Request.ContentType = "text/xml; charset=utf-8";
System.IO.StreamReader reqStream = new
System.IO.StreamReader(context.Request.InputStream );
irw.message = reqStream.ReadToEnd().Trim();
da.process_message(); // The file is proceesed and the response is stored in
the member "message"
context.Response.ContentType = "text/xml; charset=utf-8";
UTF8Encoding encoding = new UTF8Encoding();
byte[] postBytes = encoding.GetBytes(da.message);
context.Response.OutputStream.Write(postBytes, 0, postBytes.Length);
}
catch(Exception exe)
{
Log.Write(exe);
}
}
Thanks
JJ