开发者

WCF callback contracts and server to server

I am 开发者_运维百科developing a solution with multiple WCF services which all communicate among themselves, even though they are of different types. The services connect to one another through the ChannelFactory generic interface, and every service is hosted inside a ServiceHost.

My question is if it would be correct to use a callback contract among the servers to communicate with one another and if so how would such a solution look.

Currently I don't like the implementation because every service needs to host a couple of endpoints with different interfaces some for other services and some for other clients.

When I tried to implement the callback contract inside a service class that was hosted inside a ServiceHost it failed.


First of all, whenever you post a question saying, "it failed", you need to tell us in what way it failed. If there was an exception, then you need to post the entire exception, including all InnerException instances, by posting the result of ex.ToString().

To your problem, I'd implement a service contract that represents the part of each service that needs to talk to the other services. There would also be a callback contract associated with this service contract.

That way, it's as though each service operates a miniature service intended only for service-to-service communications. They can then each do their own thing with the information that is passed between the services.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜