code is as follows----
HttpWebRequest oHttpWebRequest = (HttpWebRequest)
(WebRequest.Create("http://xxx.com/abc/abc"));
Byte[] bytes = sXMLRequestStream.ToArray();
//convert byte array to string
string strReq;
strReq = Encoding.ASCII.GetString(bytes);
//convert byte array to string ends here
oHttpWebRequest.ContentType = "application/x-www-form-
urlencoded";
oHttpWebRequest.Method = "POST";
oHttpWebRequest.ContentLength = bytes.Length;
Stream oWStream = oHttpWebRequest.GetRequestStream();
oWStream.Write(bytes, 0, bytes.Length);
oWStream.Close();
//to receive
HttpWebResponse oHttpWebResponse = (HttpWebResponse)
(oHttpWebRequest.GetResponse());
OutResStream = oHttpWebResponse.GetResponseStream();
Pls suggest!!!1
-----Original Message-----
"sumit" wrote:
Hi,
I am trying to send an XML request from ASPX page to A
servlet,,,and gets the XML response back. I am using
HttpWebRequest object. It throws exception as:
The underlying connection was closed: The server
committed an HTTP protocol violation.
Previously it was working fine but suddenly it has given
error like this,,,,and sometimes this error comes but
sometimes it doesnot.
Please suggest
Um.. post some code?
--
Joerg Jooss
jo*********@gmx.net
.