Http web request error when trying to consume a webservice

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
 
J

Joerg Jooss

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top