我已设置我的 servicefabric 有状态服务以使用两个侦听器端点
- 远程服务 V2
- WCF 远程处理
我的CreateServiceReplicaListerners()
长相是这样的——
return new[]
{
new ServiceReplicaListener((c) => new FabricTransportServiceRemotingListener(c, this),
"dataServiceRemotingListener"),
new ServiceReplicaListener((context) =>
new WcfCommunicationListener<IReferenceDataService>(
wcfServiceObject:this,
serviceContext:context,
//
// The name of the endpoint configured in the ServiceManifest under the Endpoints section
// that identifies the endpoint that the WCF ServiceHost should listen on.
//
endpointResourceName: "WcfDataServiceEndpoint",
//
// Populate the binding information that you want the service to use.
//
listenerBinding: WcfUtility.CreateTcpListenerBinding()
), "dataServiceWCFListener")
};
但是,在测试中我发现只有一个端点有效。具体来说,只有第一个注册的作品。在上述情况下,服务远程处理工作但 WCF 侦听器没有。在我试图进行 wcf 调用的客户端中,我不断收到错误消息 -The provided URI scheme 'localhost' is invalid; expected 'net.tcp'.
当更改它们的注册顺序时,WCF 远程处理工作但 SeviceRemoting 不工作。这看起来像一个错误,不知道是否有人遇到过类似的问题?
请指教。
更新:
这是我的客户端详细信息
_service = serviceProxyFactory.CreateServiceProxy<IReferenceDataService>(
new Uri("fabric:/DataService/ReferenceDataService"),
new ServicePartitionKey(0));