简体   繁体   English

使用介于两者之间的RoutingService,客户端与WCF服务之间的安全松散耦合通信

[英]Secure and loose coupled communication between clients and WCF services using a RoutingService in between

Is it possible to send objects through RoutingService to peer WCF services without having the router know about the exact type of these objects ? 是否可以通过RoutingService将对象发送到对等WCF服务,而无需路由器知道这些对象的确切类型

My intention is to create a router once for all , then be able to add new WCF services, dynamically add them to the routing table, and allow clients to communicate with these services without having to stop, change the code of the router, then start it again. 我的目的是建立一个路由器就只这一次 ,然后就可以添加新的WCF服务,动态地将它们添加到路由表,并允许客户端与这些服务进行通信,而无需停止,更改路由器的代码,然后再启动再来一次。

I was thinking of a generic contract like this: 我在想这样的通用合同:

[DataContract]
public class RequestObject
{
}

[DataContract]
public class ReplyObject
{
}

[ServiceContract]
public interface IGenericServiceInterface
{
    [OperationContract]
    ReplyObject DoJob(string jobType, RequestObject request);
}

I could put this in a common library that all 3 components link to (client, router, services). 我可以将其放在一个公共库中,所有3个组件都链接到该库(客户端,路由器,服务)。 But, I am not sure, it will be possible to derive new sub classes to allow new clients/services with new data exchanges to be added without having to change the router. 但是,我不确定,是否有可能派生新的子类,以允许添加具有新数据交换的新客户端/服务,而无需更改路由器。

Any advise ? 有什么建议吗? is it possible for the solution to work when encryption is enforced through clients till services ? 当通过客户端直到服务强制实施加密时,该解决方案是否可行?

Thanks in advance. 提前致谢。

There's a good msdn on using the Message class in WCF to build contract agnostic endpoints. 关于在WCF中使用Message类来构建与合约无关的终结点有很好的建议。 Does not use routing service, but you could build a router using this: 不使用路由服务,但是您可以使用以下方法构建路由器:

http://msdn.microsoft.com/en-us/library/ms734675.aspx http://msdn.microsoft.com/en-us/library/ms734675.aspx

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

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