all groups > dotnet xml > september 2005 >
You're in the

dotnet xml

group:

Connection error on Document Load



Connection error on Document Load Harry Keck
9/28/2005 1:53:08 PM
dotnet xml: I am calling XmlDocument.Load with a url string, but get the message "The
underlying connection was closed: Unable to connect to the remote server."
When I put the exact same URL in IE, the xml file comes up just fine. Also,
we only get this error when running from some machines, not all. Does anyone
Re: Connection error on Document Load Q
9/29/2005 10:17:37 AM
I was getting the same kind of error using XmlTextReader with a url string.
Check out the following:

http://support.microsoft.com/?kbid=888527 and look at the section on
Undocumented bugs in the .NET Class Library (NCL).

Also, google the term: useUnsafeHeaderParsing for more info on the problem.
It seems that in .NET 1.0 SP3 and beyond a change was made in what is
considered a mal-formed http header. Basically you need to add the
following section to your apps config file:

<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>

Hope this helps....

[quoted text, click to view]

AddThis Social Bookmark Button