473,379 Members | 1,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

HttpRequest (well known by now..) error

Hi,

does anybody have found a working solution for this HttpRequest error :
"ServerProtocolViolation/The server committed a protocol violation.
Section=ResponseStatusLine"

i tried the solution regarding the app.config file, by puting there the
following

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing = "true" />
</settings>
</system.net>
</configuration>

on the client (and the server that is runnign an http server software)
but i keep getting the same message...
Thanks a lot for any help
Jun 22 '06 #1
4 4358
The documentation for the UseUnsafeHeaderParsing property on the
HttpWebRequestElement states the following:

Header names cannot have non-ASCII chars in them. This validation is
performed whether this property is set to true or false.

I'm assuming that this is the problem that you are facing. It's really
an error on the server's part, and that is the area where it should be
fixed.

You might have to resort to parsing the headers/etc, etc yourself.
Either that, or use another third party provider (perhaps IP works).

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"objectref" <an******@mediatrel.com> wrote in message
news:us**************@TK2MSFTNGP04.phx.gbl...
Hi,

does anybody have found a working solution for this HttpRequest error :
"ServerProtocolViolation/The server committed a protocol violation.
Section=ResponseStatusLine"

i tried the solution regarding the app.config file, by puting there the
following

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing = "true" />
</settings>
</system.net>
</configuration>

on the client (and the server that is runnign an http server software)
but i keep getting the same message...
Thanks a lot for any help

Jun 22 '06 #2
Thanks for the reply!

I initialize a stream writer on the server part to write something on the
socet that took the http request.
You mean that is something there that is not correct ?
Thanks again..

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:OV**************@TK2MSFTNGP04.phx.gbl...
The documentation for the UseUnsafeHeaderParsing property on the
HttpWebRequestElement states the following:

Header names cannot have non-ASCII chars in them. This validation is
performed whether this property is set to true or false.

I'm assuming that this is the problem that you are facing. It's really
an error on the server's part, and that is the area where it should be
fixed.

You might have to resort to parsing the headers/etc, etc yourself.
Either that, or use another third party provider (perhaps IP works).

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"objectref" <an******@mediatrel.com> wrote in message
news:us**************@TK2MSFTNGP04.phx.gbl...
Hi,

does anybody have found a working solution for this HttpRequest error :
"ServerProtocolViolation/The server committed a protocol violation.
Section=ResponseStatusLine"

i tried the solution regarding the app.config file, by puting there the
following

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing = "true" />
</settings>
</system.net>
</configuration>

on the client (and the server that is runnign an http server software)
but i keep getting the same message...
Thanks a lot for any help


Jun 22 '06 #3
objectref wrote:
Thanks for the reply!

I initialize a stream writer on the server part to write something on the
socet that took the http request.
You mean that is something there that is not correct ?
Thanks again..
Yes, that is probably what is happening.

I some time ago I needed to connect to a web service that returned no
headers at all, just the content. I ended up writing a HTTP request
directly to a tcp connection and reading the results. The
HttpRequest/Response classes in .Net are *very* strict when it comes to
the actual protocol.

You should not that the HTTP protocol is quite complex. The easiest
solution is to host your application in IIS as an ASP.net application so
that it can offload all the protocol stuff from you. But if that is not
possible, then have a look at the System.Net.HttpListener class instead
of rolling your own solution on the server side.

Kind regards,

Jesse Houwing
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:OV**************@TK2MSFTNGP04.phx.gbl...
The documentation for the UseUnsafeHeaderParsing property on the
HttpWebRequestElement states the following:

Header names cannot have non-ASCII chars in them. This validation is
performed whether this property is set to true or false.

I'm assuming that this is the problem that you are facing. It's really
an error on the server's part, and that is the area where it should be
fixed.

You might have to resort to parsing the headers/etc, etc yourself.
Either that, or use another third party provider (perhaps IP works).

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"objectref" <an******@mediatrel.com> wrote in message
news:us**************@TK2MSFTNGP04.phx.gbl...
Hi,

does anybody have found a working solution for this HttpRequest error :
"ServerProtocolViolation/The server committed a protocol violation.
Section=ResponseStatusLine"

i tried the solution regarding the app.config file, by puting there the
following

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing = "true" />
</settings>
</system.net>
</configuration>

on the client (and the server that is runnign an http server software)
but i keep getting the same message...
Thanks a lot for any help


Jun 23 '06 #4

Hey Jesse,

thanks for the help!

The funny thing is that the app is relatevely simple and it is
a clasic windows applicatio.
Socket opens, send data and receive data, just like you describe.
objectref
"Jesse Houwing" <je***********@nospam-sogeti.nl> wrote in message
news:uj**************@TK2MSFTNGP03.phx.gbl...
objectref wrote:
Thanks for the reply!

I initialize a stream writer on the server part to write something on the
socet that took the http request.
You mean that is something there that is not correct ?
Thanks again..


Yes, that is probably what is happening.

I some time ago I needed to connect to a web service that returned no
headers at all, just the content. I ended up writing a HTTP request
directly to a tcp connection and reading the results. The
HttpRequest/Response classes in .Net are *very* strict when it comes to
the actual protocol.

You should not that the HTTP protocol is quite complex. The easiest
solution is to host your application in IIS as an ASP.net application so
that it can offload all the protocol stuff from you. But if that is not
possible, then have a look at the System.Net.HttpListener class instead of
rolling your own solution on the server side.

Kind regards,

Jesse Houwing

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:OV**************@TK2MSFTNGP04.phx.gbl...
The documentation for the UseUnsafeHeaderParsing property on the
HttpWebRequestElement states the following:

Header names cannot have non-ASCII chars in them. This validation is
performed whether this property is set to true or false.

I'm assuming that this is the problem that you are facing. It's
really an error on the server's part, and that is the area where it
should be fixed.

You might have to resort to parsing the headers/etc, etc yourself.
Either that, or use another third party provider (perhaps IP works).

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"objectref" <an******@mediatrel.com> wrote in message
news:us**************@TK2MSFTNGP04.phx.gbl...
Hi,

does anybody have found a working solution for this HttpRequest error :
"ServerProtocolViolation/The server committed a protocol violation.
Section=ResponseStatusLine"

i tried the solution regarding the app.config file, by puting there the
following

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing = "true" />
</settings>
</system.net>
</configuration>

on the client (and the server that is runnign an http server software)
but i keep getting the same message...
Thanks a lot for any help


Jun 23 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: HikksNotAtHome | last post by:
In Mozilla 1.4b, when the URL is set to a local URL, it works as expected. function showIt(){ var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "blank.html" ,true);...
0
by: Bp | last post by:
I'm writing a simple HTTPRequest that retrieves the content of a web page. Dim httpReq As System.Net.HttpWebRequest Dim httpResp As System.Net.HttpWebResponse httpReq =...
4
by: bobsawyer | last post by:
I've been building a series of SELECT lists that are populated dynamically using HTTPRequest. Things are going pretty well, and I've got the whole thing working flawlessly in Mozilla/Firebird....
4
by: Daniel Rimmelzwaan | last post by:
I am having trouble getting the XML out of an HttpRequest object. I am sending the XML from biztalk into my aspx page, after which I want to take the XML out of it and process it using a...
1
by: Mark Miller | last post by:
I just recently started getting the above error on a page I am posting MULTIPART/FORM-DATA. We have SoftArtisans FileUp component and Filter installed on the server in question and up until a day...
19
by: Bill Cohagan | last post by:
I'm constructing an ASP page that I'd like to test by writing a program that simulates "many" users hitting the submit button on a form. I assume it's possible to manually construct an httprequest...
1
by: Gunnar | last post by:
I am finding some unusual behavior with techniques I am using to show/hide/update data without having to refresh the page. I'm quite sure it's developer ignorance on my part and would be grateful...
1
by: Jeff | last post by:
ASP.NET 2.0 I'm about to program a HttpRequest from my asp.net 2.0 website. I'll request another server using HttpRequest and ask if password etc are okay.... So I've looked into the...
2
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: I want to add HttpRequest class to my windows application, I add the System.Web.dll to my project as refreance . but I still get the blue Line under HttpReqesut class as error. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.