Hi,
for the past while ive been stuck with the following
error when i debug my application
"The server committed a protocol violation.
Section=ResponseStatusLine"
My application is sends 2 requests to a java servlet.
The first request works fine.
If I try to send any other request the error occurs.
Ive looked around online about the error.
I tried setting <httpWebRequest
useUnsafeHeaderParsing="true" /> in the web config file
but it does not work.
Also I read that the iis server has problems if another
application is using port 80.
The servlet is configured to run on port 80 so I changed
it to port 81.
I still get the error.
For a while I thought the problem was with session cookies but after investigation this turned out not to be the case.
I nearly certain that the problem does not lay in my code either.
Im really baffled as to why this error is occuring.
Any help or insight would be greatly appreciated.
Thanks
Dub
/////Request 1
string url = " string result = string.Empty;
string postData = "msisdn0=862324984";
Uri uri = new Uri(url);
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(uri + "demo1_res");
request.Method = "POST";
request.ContentType =
"application/x- request.ContentLength = postData.Length;
// request.Referer =
" request.ProtocolVersion =
HttpVersion.Version11;
Stream writeStream =
request.GetRequestStream();
UTF8Encoding encoding = new UTF8Encoding();
byte[] bytes = encoding.GetBytes(postData);
writeStream.Write(bytes, 0, bytes.Length);
HttpWebResponse response =
(HttpWebResponse)request.GetResponse();
Stream responseStream =
response.GetResponseStream();
StreamReader readStream = new
StreamReader(responseStream);
result = readStream.ReadToEnd();
////////////////////////////////////
/////Request 1
for the past while ive been stuck with the following
error when i debug my application
"The server committed a protocol violation.
Section=ResponseStatusLine"
My application is sends 2 requests to a java servlet.
The first request works fine.
If I try to send any other request the error occurs.
Ive looked around online about the error.
I tried setting <httpWebRequest
useUnsafeHeaderParsing="true" /> in the web config file
but it does not work.
Also I read that the iis server has problems if another
application is using port 80.
The servlet is configured to run on port 80 so I changed
it to port 81.
I still get the error.
For a while I thought the problem was with session cookies but after investigation this turned out not to be the case.
I nearly certain that the problem does not lay in my code either.
Im really baffled as to why this error is occuring.
Any help or insight would be greatly appreciated.
Thanks
Dub
/////Request 1
string url = " string result = string.Empty;
string postData = "msisdn0=862324984";
Uri uri = new Uri(url);
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(uri + "demo1_res");
request.Method = "POST";
request.ContentType =
"application/x- request.ContentLength = postData.Length;
// request.Referer =
" request.ProtocolVersion =
HttpVersion.Version11;
Stream writeStream =
request.GetRequestStream();
UTF8Encoding encoding = new UTF8Encoding();
byte[] bytes = encoding.GetBytes(postData);
writeStream.Write(bytes, 0, bytes.Length);
HttpWebResponse response =
(HttpWebResponse)request.GetResponse();
Stream responseStream =
response.GetResponseStream();
StreamReader readStream = new
StreamReader(responseStream);
result = readStream.ReadToEnd();
////////////////////////////////////
/////Request 1