加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 什么可能导致一个服务器上的此错误,但不是另一个?

发布时间:2020-12-16 07:00:12 所属栏目:asp.Net 来源:网络整理
导读:我们有一个连接到外部Web服务的ASP.Net网站,它几天前突然停止工作. 基本代码是这样的: Try request = New ExternalWebService.ProcessRequestService ' Error occurs here: response = request.processCommand(parameters) ' Do some other stuff with resp
我们有一个连接到外部Web服务的ASP.Net网站,它几天前突然停止工作.

基本代码是这样的:

Try
    request = New ExternalWebService.ProcessRequestService

    ' Error occurs here:
    response = request.processCommand(parameters)

    ' Do some other stuff with response here

Catch webEx As System.Net.WebException

    ' This triggers and generic error gets displayed

Catch ex As Exception

Finally

End Try

使用SendFailure异常触发System.Net.WebException,并返回此堆栈跟踪:

The underlying connection was closed: An unexpected error occurred on a send. -
    at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
    at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName,Object[] parameters)
    at ExternalWebService.ProcessRequestService.processCommand(parameters)

当我尝试在我的开发机器上调试此问题时,它工作正常,不会发生异常.

我们的网络服务器最近没有更新,我可以使用FireFox从Web服务器连接到wsdl服务(但我无法与IE连接,但这可能与我们在网络服务器上与IE有关的其他问题有关)

我已经尝试了为错误消息#2 here发布的所有解决方案,包括设置KeepAlive = False和ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3,但是没有人能解决这个问题.

我们的网络服务器运行Windows Server 2003和IIS6.0

什么可能导致这个错误发生在一台机器上,而不是另一台机器上?

编辑:这是跟踪信息:

System.Web.Services.Asmx Information: 0 : Calling XmlSerializer [Create XmlSerializer]
    Method: System.Xml.Serialization.XmlSerializer#1669721556::FromMappings(System.Xml.Serialization.XmlMapping[]#4002219=[4],ExternalWebService.ProcessRequestService#93032588=ExternalWebService.ProcessRequestService)
    Caller: System.Web.Services.Protocols.SoapClientType#42808772::.ctor(ExternalWebService.ProcessRequestService#93032588=ExternalWebService.ProcessRequestService)
    ProcessId=2796
    LogicalOperationStack=
    ThreadId=14
    DateTime=2012-12-21T17:02:39.2826250Z
    Timestamp=61755143048799345
System.Web.Services.Asmx Information: 0 : Return from XmlSerializer [Create XmlSerializer]
    Caller: System.Web.Services.Protocols.SoapClientType#42808772::.ctor(ExternalWebService.ProcessRequestService#93032588=ExternalWebService.ProcessRequestService)
    ProcessId=2796
    LogicalOperationStack=
    ThreadId=14
    DateTime=2012-12-21T17:02:39.6576250Z
    Timestamp=61755144323396760
System.Web.Services.Asmx Information: 0 : Calling XmlSerializer [Write Request]
    Method: Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer#1231684::Serialize(System.Xml.XmlTextWriter#8023888=..,System.Object[]#19695157=[40],(null),(null))
    Caller: ExternalWebService.ProcessRequestService#60553900::Serialize()
    ProcessId=2796
    LogicalOperationStack=
    ThreadId=14
    DateTime=2012-12-21T17:02:39.7357500Z
    Timestamp=61755144598320131
System.Web.Services.Asmx Information: 0 : Return from XmlSerializer [Write Request]
    Caller: ExternalWebService.ProcessRequestService#60553900::Serialize()
    ProcessId=2796
    LogicalOperationStack=
    ThreadId=14
    DateTime=2012-12-21T17:02:39.7357500Z
    Timestamp=61755144621621529
System.Web.Services.Asmx Information: 0 : Calling WebRequest.GetResponse
    Method: System.Net.HttpWebRequest#2800407::GetResponse()
    Caller: ExternalWebService.ProcessRequestService#60553900::GetWebResponse()
    ProcessId=2796
    LogicalOperationStack=
    ThreadId=14
    DateTime=2012-12-21T17:02:39.7357500Z
    Timestamp=61755144622114240

解决方法

显然在我的特定情况下,这是因为Web服务供应商增加了他们的安全性,而我们的Web服务器没有解密连接所需的正确库.

我们唯一的线索是一个系统事件查看器条目,其ID为36874,并且在我们网站停止工作的同一天回来的Schannel来源说:

An SSL connection request was received from a remote client
application,but none of the cipher suites supported by the client
application are supported by the server. The SSL connection request
has failed.

但是,如果你自己调试这个问题,this link非常有用,因为它给出了一些错误的错误描述,它指出了我正确的方向,我的问题与无法连接到他们的Web服务有关.

The underlying connection was closed: An unexpected error occurred on a send

This problem occurs when the client computer cannot send an HTTP
request. The client computer cannot send the HTTP request because the
connection has been closed or is unavailable. Lookup the error in
this article 07001.

并且链接的Microsoft支持页面也非常详细地介绍了您可以尝试解决此问题的最常见原因的一些不同的解决方案.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读