在Azure服务结构中托管WCF服务

在Azure服务结构中托管WCF服务,wcf,azure-service-fabric,wcf-binding,service-fabric-stateless,Wcf,Azure Service Fabric,Wcf Binding,Service Fabric Stateless,我有一组WCF服务,我想迁移到Azure服务结构。我正在为每个WCF服务创建一个服务结构无状态服务,并从我的结构服务中引用WCF服务库和合同。我的目标是对现有WCF服务库和合同进行零代码更改。fabric服务的作用类似于包装器 我成功地实现了简单服务,我将WCF服务配置放入fabric service.NET framework的app.config文件中,现有WCF代码中的system.configuration.configurationmanager调用似乎工作正常 然而,我尝试迁移的许多

我有一组WCF服务,我想迁移到Azure服务结构。我正在为每个WCF服务创建一个服务结构无状态服务,并从我的结构服务中引用WCF服务库和合同。我的目标是对现有WCF服务库和合同进行零代码更改。fabric服务的作用类似于包装器

我成功地实现了简单服务,我将WCF服务配置放入fabric service.NET framework的app.config文件中,现有WCF代码中的system.configuration.configurationmanager调用似乎工作正常

然而,我尝试迁移的许多更复杂的服务包含使用ChannelFactory调用其他WCF服务的代码。我想知道这行得通吗?Azure服务结构是否允许其服务通过ChannelFactory进行外部通信呼叫

如何读取服务结构中的WCF跟踪日志?没有本地驱动器来存储日志文件

当客户端调用结构中的wcf服务时,我还遇到了通用连接关闭错误

[编辑] 已配置负载平衡器,但客户端仍无法通过:


Could not connect to net.tcp://10.0.0.6:9012/. The connection attempt lasted for a time span of 00:00:21.0433425. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.0.0.6:9012. 
Server stack trace: 
   at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
   at System.ServiceModel.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
   at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Inner Exception:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.0.0.6:9012
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)

Azure服务结构是否允许其服务通过ChannelFactory进行外部通信呼叫

服务结构不会阻止您通过网络拨打电话。请确保在服务清单中声明,以便为调用保留端口。 如何读取服务结构中的WCF跟踪日志?没有本地驱动器来存储日志文件

您正在运行一个具有数据和临时驱动器的。但是,我建议使用存储来保存日志文件,以便在集群缩小时保持它们的安全,例如。。 当客户端调用结构中的wcf服务时,我还遇到了通用连接关闭错误

您是否将Azure配置为将流量转发到群集

您是否认为以这样的方式运行服务可能根本不需要创建SF服务?< /P>


请注意,看来WCF确实有着光明的未来。

感谢您的回复!原始wcf周围的每个服务包装器都绑定到特定的端口。我想知道如果扩展服务会发生什么,会不会有端口冲突?默认情况下,由于SF的工作方式,每个节点不会有多个服务实例。但是,如果您运行多个应用程序实例以便多次运行同一服务,则需要在清单中对此进行管理。感谢@LoekD,我的一些服务在启动后使用web api http自托管。即使每个节点只有一个实例,我有时也会遇到错误:uri的注册已经存在。这就像服务已经启动了好几次:如果从一个节点移动到另一个节点,服务可以重新启动。服务关闭时,您是否正确关闭频道?serviceHost.Close我无法控制WCF服务源代码。服务从app.config读取自主机url。我输入了一些代码来修改这个url并附加一个随机guid虚拟目录。我希望这可以避免错误,因为虚拟方向不同,但是,即使使用不同的虚拟目录,我仍然会遇到错误。