与DTD验证 - 连接强行关闭 [英] Validating with DTD - connection forcibly closed

查看:215
本文介绍了与DTD验证 - 连接强行关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我验证与DTD这是不是我的机器上的文件中的文件,它存储在互联网上。

I'm validating a document with the DTD in the document which is not on my machine, it is stored on the internet.

我目前正在以下例外

System.Xml.XmlException: An error has occurred while opening external DTD 'http://xml.cxml.org/schemas/cXML/1.2.020/cXML.dtd': Unable to connect to the remote server ---> 
System.Net.WebException: Unable to connect to the remote server --->
System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host 216.109.104.11:80
   
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   
at System.Net.HttpWebRequest.GetResponse()
   
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)
   
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)
  
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
   
at System.Xml.XmlTextReaderImpl.OpenStream(Uri uri)
   
at System.Xml.XmlTextReaderImpl.DtdParserProxy_PushExternalSubset(String systemId, String publicId)
   --- End of inner exception stack trace ---
   
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   
at System.Xml.XmlTextReaderImpl.DtdParserProxy_PushExternalSubset(String systemId, String publicId)
   
at System.Xml.XmlTextReaderImpl.DtdParserProxy.System.Xml.IDtdParserAdapter.PushExternalSubset(String systemId, String publicId)
   
at System.Xml.DtdParser.ParseExternalSubset()
   
at System.Xml.DtdParser.ParseInDocumentDtd(Boolean saveInternalSubset)
   
at System.Xml.DtdParser.Parse(Boolean saveInternalSubset)
   
at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()
   
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   
at System.Xml.XmlTextReaderImpl.Read()
   
at System.Xml.XmlValidatingReaderImpl.Read()
   
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
   
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   
at System.Xml.XmlDocument.Load(XmlReader reader)
   
at cXML.ResponseFactory..ctor(HttpRequest request) :: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host 216.109.104.11:80
   
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   
at System.Net.HttpWebRequest.GetResponse()
   
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)
   
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)
   at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
   
at System.Xml.XmlTextReaderImpl.OpenStream(Uri uri)
   
at System.Xml.XmlTextReaderImpl.DtdParserProxy_PushExternalSubset(String systemId, String publicId) :: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host 216.109.104.11:80
   
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)

我知道该文件是可访问的,因为我可以浏览到它。但是,为什么不能.NET访问它?
在此先感谢

I know the file is accessible as I can browse to it. But why cannot .NET access it?! Thanks in advance.

推荐答案

我得到了以下情况例外,当我浏览[的 http://xml.cxml.org/schemas/cXML/1.2.020/cXML.dtd ] DTD文件

I got following exception when i browse the [http://xml.cxml.org/schemas/cXML/1.2.020/cXML.dtd ] dtd file.

XML解析错误:语法错误
地点:的 http://xml.cxml.org/schemas/cXML/1.2.020/cXML.dtd
线15号,第1列:

XML Parsing Error: syntax error Location: http://xml.cxml.org/schemas/cXML/1.2.020/cXML.dtd Line Number 15, Column 1:

只要下载DTD文件,并尝试在本地访问DTD。你可以缩小你的问题。

Just download the dtd file and try to access the dtd locally. You can narrow down your problem.

这篇关于与DTD验证 - 连接强行关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆