简体   繁体   English

WCF如何将ServiceContract / OperationContract转换为可以序列化的消息?

[英]How does WCF turn a ServiceContract/OperationContract into a Message that can be serialized?

I'm starting to experiment with using ActiveMQ (in conjunction with the ActiveMQ.NMS bindings) to support some cross platform RPC messaging that we're looking at doing. 我开始尝试使用ActiveMQ(结合ActiveMQ.NMS绑定)来支持我们正在考虑的一些跨平台RPC消息传递。

As part of this I'd like to be able to define our RPC contracts in the manner WCF provides - eg. 作为其中的一部分,我希望能够以WCF提供的方式定义我们的RPC合同-例如。

[ServiceContract]
public interface IUsers
{
    [OperationContract]
    IEnumerable<IUser> void GetByEmail(string email);
}

And I'm looking at contributing to the ApackeMQ.NMS.WCF project to allow this to work, and I have some experience at writing custom bindings so I'm away with that. 我正在为ApackeMQ.NMS.WCF项目做出贡献,以使其能够正常工作,并且我在编写自定义绑定方面有一些经验,因此我不再这样做。

However, I'm having trouble with a conceptual issue first with how WCF operates. 但是,我首先要解决WCF如何运作的概念性问题。 Obviously at some level a call through a proxy on a client channel for "GetByEmail" must get converted into message and response objects so that they can be serialized. 显然,在某个级别上,必须通过客户端通道上的代理对“ GetByEmail”进行的调用必须转换为消息和响应对象,以便可以对其进行序列化。 I'd like to be able to know how this works to get a better overall understanding of WCF. 我想知道这是如何工作的,以便更好地全面了解WCF。

I am unable to find any documentation as to exactly how that is done and indeed which classes within the fairly hefty WCF infrastructure are involved. 我找不到任何文件来确切地了解如何完成操作以及确实在相当庞大的WCF基础结构中涉及哪些类。

Has anyone got any pointers? 有人有指针吗? A top level explanation and/or directions to the classes would be brilliant. 最高级别的解释和/或上课的指导将会很棒。

Thanks. 谢谢。

There is a step before that: How (what format) to use for the serialization? 在此之前有一个步骤:序列化如何使用(哪种格式)?

WCF connects through Bindings, and the configuration of the binding picks a format/protocol. WCF通过绑定进行连接,并且绑定的配置选择一种格式/协议。

And 'how' the command is transferred for each protocol? 每种协议如何“传递”命令? I don't know and I don't think it will be very helpful to dig into that (low level) stuff. 我不知道,我认为深入研究(低级别)内容也不会很有帮助。

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

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