In .Net 2/3 one can consume the NOAA web service WSDL at (http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl) and run into this error
| Exception: | System.Net.WebException |
| Message: | The server committed a protocol violation. Section=ResponseStatusLine |
| Source: | System.Web.Services |
| TargetSite: | System.Net.WebResponse GetWebResponse(System.Net.WebRequest) |
 To get around this issue open up the generated reference.cs file and add this to the web service proxy class and rebuild and run
protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(uri);
request.ProtocolVersion = HttpVersion.Version10;
return request;
}
Thanks goes to Rob Garret’s blog on this.
#1 by Peter Ritchie on May 28, 2007 - 12:40 pm
Quote
Alternatively you may be able to add the following to your app.config:
This way, if the NOA site stops having a protocol violation you don’t have to recompile your app.
#2 by Peter Ritchie on May 29, 2007 - 9:40 am
Quote
Alternatively you may be able to add the following to your app.config:
This way, if the NOA site stops having a protocol violation you don’t have to recompile your app.
#3 by omegaman on May 29, 2007 - 10:37 am
Quote
it appears that this blog cannot handle html comments
abc
#4 by RFish on September 11, 2007 - 1:38 pm
Quote
Where is the “generated reference.cs” file? All I can see in VS is a .discomap and a .wsdl file. (I’m learning VS2005 right now)
#5 by omegaman on September 11, 2007 - 6:45 pm
Quote
I have written a blog entitled Where are the Hidden Files using Visual Studio 2005?