我们有一个.NET 3.5 Web应用程序,它使用第三方Web服务。代理是通过向其WSDL添加Web引用而创建的。未编译此代理。
我们的错误日志记录收集了频繁但间歇性的异常:
“System.Web.Services.Protocols.SoapHeaderException”类型的异常发生并被捕获
如果我跟踪生成异常的页面的URL,就无法重新创建它。
编辑:这里是大多数的例外——它从那里冒出来
Message : Internal Error
Type : System.Web.Services.Protocols.SoapHeaderException, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Source : System.Web.Services Help link :
Actor :
Code : http://schemas.xmlsoap.org/soap/envelope/:Client
Detail :
Lang :
Node :
Role :
SubCode :
Data : System.Collections.ListDictionaryInternal
TargetSite : System.Object[] ReadResponse(System.Web.Services.Protocols.SoapClientMessage, System.Net.WebResponse, System.IO.Stream, Boolean)
Stack Trace : at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Vendor.getSearch(getSearchRequest getSearchRequest) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\be43c34e\b09edc7e\App_WebReferences.pww-cf-q.0.cs:line 73
编辑2:内部异常:
我有时会记录以下内部异常:
Message : Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Type : System.IO.IOException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source : System
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Int32 Read(Byte[], Int32, Int32)
Stack Trace : at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.TlsStream.CallProcessAuthentication(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.WriteHeaders(Boolean async)
和/或:
Message : An existing connection was forcibly closed by the remote host
Type : System.Net.Sockets.SocketException, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Source : System
Help link :
ErrorCode : 10054
SocketErrorCode : ConnectionReset
NativeErrorCode : 10054
Data : System.Collections.ListDictionaryInternal
TargetSite : Int32 Receive(Byte[], Int32, Int32, System.Net.Sockets.SocketFlags)
Stack Trace : at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
更新
我们还在努力。最初有一个路由问题,解决了。我们仍然得到了套接字错误的内部异常。今天我们有微软的支持,他们查看了一些跟踪和网络捕获。Web服务主机执行循环DNS,它们可能在一个IP的syn-syn/ack的另一个IP地址上响应,另一个IP的syn/ack的另一个IP地址上响应。这不好。这很可能是针对我们的情况,但也可能适用于其他人。
Microsoft网络监视器和应用程序跟踪为我们提供了所需的信息。