【问题标题】:WCF service error while recieving the HTTP response接收 HTTP 响应时出现 WCF 服务错误
【发布时间】: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


【解决方案1】:

通过签入WCF服务日志解决

问题是我有一个枚举并且我将枚举值存储在数据库中。现在该 Enum 的索引已更改,因此当我从数据库中获取值并将数据库值再次转换为 Enum 时,它给了我一个错误。并且在测试环境中,所有数据库值在 Enum 中都有映射,这就是为什么在测试环境中它在获取记录时不会引发错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-29
    • 2014-06-03
    • 1970-01-01
    • 2020-07-24
    • 2013-02-26
    • 2023-01-30
    • 1970-01-01
    相关资源
    最近更新 更多