简体   繁体   English

部署WCF服务的问题

[英]Issues Deploying a WCF service

We're trying to deploy a web site that uses a WCF service - everything worked in test - but when we put it live (pointing to the same WCF service) via an external facing IP it stopped working. 我们正在尝试部署一个使用WCF服务的网站-一切都在测试中正常工作-但当我们通过面向外部的IP将其投入使用(指向同一WCF服务)时,该网站便停止工作。

When we paste the url into a browser it displays the basic web page - but when we try it via the app it give us an error (see below) 当我们将网址粘贴到浏览器中时,它会显示基本的网页-但是,当我们通过应用程序尝试该网址时,会给我们一个错误(请参见下文)

config section ... 配置部分...

<client>
  <endpoint address="http://123.321.123.321:8731/N3/WebsiteIntegrationService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IWebsiteIntegrationService" contract="AccessService.IWebsiteIntegrationService" name="WSHttpBinding_IWebsiteIntegrationService">
    <identity>
      <userPrincipalName value="myname@mydomain" />
      <dns value="webservername"/>
    </identity>
  </endpoint>
</client>

error ... 错误...

Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout) at System.ServiceModel.ClientBase 1.System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout) at System.ServiceModel.ClientBase 1.Close() at System.ServiceModel.ClientBase`1.System.IDisposable.Dispose() 异常重新抛出为[0]:在System.ServiceModel的System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&msgData,Int32类型)的System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)处。 System.ServiceModel.ClientBase 1.System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout) at System.ServiceModel.ClientBase (TimeSpan超时)在System.ServiceModel.ClientBase 1.System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout) at System.ServiceModel.ClientBase 1.Close()处。 Dispose()

and .. 和..

The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. 通信对象System.ServiceModel.Channels.ServiceChannel由于处于故障状态,因此无法用于通信。
System.ServiceModel.CommunicationObjectFaultedException Void HandleReturnMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessage) System.ServiceModel.CommunicationObjectFaultedException虚空HandleReturnMessage(System.Runtime.Remoting.Messaging.IMessage,System.Runtime.Remoting.Messaging.IMessage)
Server stack trace: 服务器堆栈跟踪:
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout) 在System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan超时)处

... but the same service is still working via our local test app - we can even use the external facing IP. ...但是相同的服务仍可以通过我们的本地测试应用程序运行-我们甚至可以使用面向外部的IP。

Can anyone point me in the right direction please? 谁能指出我正确的方向?

The endpoint address should be the one at which the service is installed (ie use the port on the machine, not the external port defined in the router's nat table). 端点地址应该是安装服务的地址(即使用计算机上的端口,而不是路由器的nat表中定义的外部端口)。

I had a similar situation with a web farm where the external calls are made through https but internally the load balancer calls the actual machine in the farm through http. 我在Web场中也有类似情况,外部调用是通过https进行的,但内部负载均衡器会通过http调用场中的实际计算机。 For this to work, all config settings on the service (behaviors, endpoint) are using http addresses because that's the way they are being called. 为此,服务(行为,端点)上的所有配置设置都使用http地址,因为这就是调用它们的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM