Http web request error when trying to consume a webservice

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I had written an application in .Net 1.1 to consume a webservice.
Recently we converted the project to .Net 2.0. After the conversion to .net
2.0 the application does not work anymore.

The following error is returned when we make a Http Web request
"The server committed a protocol violation. Section=ResponseStatusLine"

Following the piece of code where it fails only in .net 2.0 but works in
..net 1.1
=========================
HttpWebRequest Request = (HttpWebRequest)HttpWebRequest.Create(url);
Request.Credentials = GetCredentials(url);
//Send the request and wait for response.
Response = (HttpWebResponse)Request.GetResponse(); --> Here it fails
=========================

I think it is related to some unsafe header information. I also followed the
following trick to ignore unsafe headers by adding the following in the
config file.
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>

Also if i try to add the web reference to the webservice in visual studio
2005 the following error

By doing this it just worked once and stopped working.

Does anyone have any idea regading the following issue ?

Thanks
 
Hello pramod,
Hi,
I had written an application in .Net 1.1 to consume a
webservice.
Recently we converted the project to .Net 2.0. After the conversion to
.net
2.0 the application does not work anymore.

The following error is returned when we make a Http Web request
"The server committed a protocol violation.
Section=ResponseStatusLine"
Following the piece of code where it fails only in .net 2.0 but works
in
.net 1.1
[...]

The best approach here is trying to get that Web Service fixed.

Cheers,
 
Back
Top