首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件开发 >

WCF技术黑幕 第5章 (5)

2013-01-27 
WCF技术内幕 第5章 (5)5.4 创建消息简要介绍Message的序列化和反序列化当发送程序需要发送一个Message到另

WCF技术内幕 第5章 (5)

5.4 创建消息

简要介绍Message的序列化和反序列化

当发送程序需要发送一个Message到另一个消息参与者时,它必须创建包含适当信息的Message对象,然后序列化和编码Message到Stream或Byte里,最后发送Stream或Byte到目的地。当接收程序收到Message时,一般来说,它还是Stream或Byte状态(和发送者最后处理的状态一样)。接收程序必须解码和反序列化stream或Byte[]为Message对象,或许还要反序列化消息头部或消息体为其他对象。


Mesage版本

        //        // Summary:        //     Gets the message version that does not use SOAP or WS-Addressing.        //        // Returns:        //     The System.ServiceModel.Channels.MessageVersion that does not use SOAP or        //     WS-Addressing.        public static MessageVersion None { get; }        //        // Summary:        //     Gets the message version using SOAP 1.1.        //        // Returns:        //     The System.ServiceModel.Channels.MessageVersion using SOAP 1.1 but no version        //     of WS-Addressing.        public static MessageVersion Soap11 { get; }        //        // Summary:        //     Gets the message version using WS-Addressing 1.0 and SOAP 1.1.        //        // Returns:        //     The System.ServiceModel.Channels.MessageVersion using the version of WS-Addressing        //     1.0 and SOAP 1.1.        public static MessageVersion Soap11WSAddressing10 { get; }        //        // Summary:        //     Gets the message version by using WS-Addressing submitted 10 August 2004        //     and SOAP 1.1.        //        // Returns:        //     The System.ServiceModel.Channels.MessageVersion using the version of WS-Addressing        //     submitted 10 August 2004 and SOAP 1.1.        public static MessageVersion Soap11WSAddressingAugust2004 { get; }        //        // Summary:        //     Gets the message version using SOAP 1.2.        //        // Returns:        //     The System.ServiceModel.Channels.MessageVersion using SOAP 1.2 but no version        //     of WS-Addressing.        public static MessageVersion Soap12 { get; }        //        // Summary:        //     Gets the message version using WS-Addressing 1.0 and SOAP 1.2.        //        // Returns:        //     The System.ServiceModel.Channels.MessageVersion using the version of WS-Addressing        //     1.0 and SOAP 1.2.        public static MessageVersion Soap12WSAddressing10 { get; }        //        // Summary:        //     Gets the message version using WS-Addressing submitted August 2004 and SOAP        //     1.2.        //        // Returns:        //     The System.ServiceModel.Channels.MessageVersion using the version of WS-Addressing        //     submitted 10 August 2004 and SOAP 1.2.        public static MessageVersion Soap12WSAddressingAugust2004 { get; }



热点排行