【发布时间】:2018-03-22 18:45:47
【问题描述】:
我在生产环境中收到响应时遇到错误。但同样的方法在测试环境中运行良好。
接收到的 HTTP 响应时出错 http://localhost:54544/Services/XXX.svc。这可能是由于 服务端点绑定不使用 HTTP 协议。这可以 也可能是由于服务器中止了 HTTP 请求上下文 (可能是由于服务关闭)。查看服务器日志了解更多信息 详情。
如果我在生产环境中使用测试数据库服务器,那么它运行得非常好
完全错误的堆栈跟踪是
服务器堆栈跟踪:在 System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest 请求, HttpAbortReason abortReason)
在 System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan 超时)在 System.ServiceModel.Channels.RequestChannel.Request(消息消息, TimeSpan 超时)在 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息 消息,TimeSpan 超时)在 System.ServiceModel.Channels.ServiceChannel.Call(字符串动作, Boolean oneway, ProxyOperationRuntime 操作, Object[] ins, Object[] 出局,TimeSpan 超时)在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime 操作)在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage 留言)在 [0] 处重新抛出异常:在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(消息数据& msgData,Int32 类型)在 Common.Infrastructure.Impl.SubService.ISubscription.GetProductLicensesByUser(字符串 用户 ID)在 Common.Infrastructure.Impl.X.Y.Z(字符串 用户 ID)在 C:\Users\XXX\Source\Repos\XXX\Src\Common.Infrastructure.Impl\Service References\XXXX\Reference.cs:第 10303 行,位于 Common.Infrastructure.Impl.X.Y(字符串 用户指南)在 C:\Users\XXXX\Source\Repos\XXX\XXXX\Common.Infrastructure.Impl\X.cs:line 1286 在 Common.Infrastructure.Impl.X.Y(字符串 用户指南)在 C:\Users\XXXX\Source\Repos\XX\XX\Common.Infrastructure.Impl\XX.cs:line 第1274章
【问题讨论】:
-
您的问题出在服务器端,而不是客户端。您需要找到服务器端异常日志记录。另请参阅:stackoverflow.com/questions/5870958/…。那个帖子里提到了各种原因,一一排除。
-
在服务器端启用消息记录和跟踪,并将 IncludeSaoapFaultException 设置为 true 并检查日志。
-
通过wcf的签入日志解决
标签: c# .net wcf wcf-data-services