Implement JSON-RPC in WCF

一曲冷凌霜 提交于 2019-12-01 13:36:35

I've written some blogs which show exactly how to do that - see the first one (which has a link to the others) at http://blogs.msdn.com/b/carlosfigueira/archive/2011/12/08/wcf-extensibility-transport-channels-request-channels-part-1.aspx.

Basically, you'll need to create a transport channel which will understand the protocol. In that transport you'll need to convert the input / output into WCF Message objects (the basic block of the WCF stack). And you'll need to deliver the messages to the rest of the stack. You'll also need to write an operation selector to map the incoming RPC message to the operation in the service which will be called.

Another alternative would be to write the JSON-RPC on top of HTTP; in this case, you should use instead of a transport channel a set of message formatter (breaking down parameters), operation selector and possibly a message inspector as well for request / reply correlation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!