【问题标题】:Port 8083: Failed to invoke the service. Possible causes: The service is offline or inaccessible8083端口:调用服务失败。可能原因:服务离线或无法访问
【发布时间】:2016-01-07 05:37:04
【问题描述】:

我有一个托管在 Windows 服务中的 wcf 服务,当在 8083 端口上运行时,来自客户端的服务方法调用会引发以下错误。但是,如果服务是在另一个端口号启动的,那么从客户端调用操作契约时不会出错。如何解决端口 8083 的错误

位于http://localhost:8083/WinService 的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(字符串操作,布尔单向,ProxyOperationRuntime 操作,Object[] 输入,Object[] 输出,TimeSpan 超时) 在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage 方法调用,ProxyOperationRuntime 操作) 在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage 消息)

在 [0] 处重新抛出异常: 在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg) 在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,Int32 类型) 在 IInterOpIntegrationWCFService.TestService(ClientIdentity objClientIdentity) 在 InterOpIntegrationWCFServiceClient.TestService(ClientIdentity objClientIdentity)

内部异常: 远程服务器返回错误:(503) 服务器不可用。 在 System.Net.HttpWebRequest.GetResponse() 在 System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan 超时)

【问题讨论】:

    标签: c# wcf windows-services


    【解决方案1】:

    对于这种情况,服务端点 WCF 必须始终提供 ABC - 地址、绑定、合同。您只需在配置中定义绑定和合同。我注意到端点地址属性中没有任何内容。

    您可以参考以下链接了解更多信息:

    Why WCF cannot be invoked in wcftestclient?

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/4d900638-dbbd-4d88-a835-bc8565e83cbf/failed-to-invoke-the-service-possible-causes-the-service-is-offline-or-inaccessible-while-invoking?forum=wcf

    回答者 http://forums.asp.net/t/2016601.aspx?wcf+test+client+failed+to+invoke+the+service

    【讨论】:

      猜你喜欢
      • 2013-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多