当前位置: 首页>>代码示例>>C#>>正文


C# Message.ReadFromBodyContentsToEnd方法代码示例

本文整理汇总了C#中Message.ReadFromBodyContentsToEnd方法的典型用法代码示例。如果您正苦于以下问题:C# Message.ReadFromBodyContentsToEnd方法的具体用法?C# Message.ReadFromBodyContentsToEnd怎么用?C# Message.ReadFromBodyContentsToEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Message的用法示例。


在下文中一共展示了Message.ReadFromBodyContentsToEnd方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateCoordinationContextResponse

 public CreateCoordinationContextResponse(Message message, Microsoft.Transactions.Wsat.Protocol.ProtocolVersion protocolVersion) : this(protocolVersion)
 {
     if (message.IsEmpty)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(Microsoft.Transactions.SR.GetString("InvalidMessageBody")));
     }
     XmlDictionaryReader readerAtBodyContents = message.GetReaderAtBodyContents();
     using (readerAtBodyContents)
     {
         this.ReadFrom(readerAtBodyContents);
         try
         {
             message.ReadFromBodyContentsToEnd(readerAtBodyContents);
         }
         catch (XmlException exception)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(Microsoft.Transactions.SR.GetString("InvalidMessageBody"), exception));
         }
     }
     try
     {
         this.IssuedToken = CoordinationServiceSecurity.GetIssuedToken(message, this.CoordinationContext.Identifier, protocolVersion);
     }
     catch (XmlException exception2)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(exception2.Message, exception2));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:CreateCoordinationContextResponse.cs

示例2: ReadMessage

 public static CreateSequenceInfo ReadMessage(MessageVersion messageVersion, ReliableMessagingVersion reliableMessagingVersion, ISecureConversationSession securitySession, Message message, MessageHeaders headers)
 {
     CreateSequenceInfo info;
     if (message.IsEmpty)
     {
         string reason = System.ServiceModel.SR.GetString("NonEmptyWsrmMessageIsEmpty", new object[] { WsrmIndex.GetCreateSequenceActionString(reliableMessagingVersion) });
         Message faultReply = WsrmUtilities.CreateCSRefusedProtocolFault(messageVersion, reliableMessagingVersion, reason);
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(WsrmMessageInfo.CreateInternalFaultException(faultReply, reason, new ProtocolException(reason)));
     }
     using (XmlDictionaryReader reader = message.GetReaderAtBodyContents())
     {
         info = CreateSequence.Create(messageVersion, reliableMessagingVersion, securitySession, reader);
         message.ReadFromBodyContentsToEnd(reader);
     }
     info.SetMessageId(messageVersion, headers);
     info.SetReplyTo(messageVersion, headers);
     if (info.AcksTo.Uri != info.ReplyTo.Uri)
     {
         string str2 = System.ServiceModel.SR.GetString("CSRefusedAcksToMustEqualReplyTo");
         Message message3 = WsrmUtilities.CreateCSRefusedProtocolFault(messageVersion, reliableMessagingVersion, str2);
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(WsrmMessageInfo.CreateInternalFaultException(message3, str2, new ProtocolException(str2)));
     }
     info.to = message.Headers.To;
     if ((info.to == null) && (messageVersion.Addressing == AddressingVersion.WSAddressing10))
     {
         info.to = messageVersion.Addressing.AnonymousUri;
     }
     return info;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:CreateSequenceInfo.cs

示例3: ReadMessage

 public static CloseSequenceInfo ReadMessage(MessageVersion messageVersion, Message message, MessageHeaders headers)
 {
     CloseSequenceInfo info;
     if (message.IsEmpty)
     {
         string str = System.ServiceModel.SR.GetString("NonEmptyWsrmMessageIsEmpty", new object[] { "http://docs.oasis-open.org/ws-rx/wsrm/200702/CloseSequence" });
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(str));
     }
     using (XmlDictionaryReader reader = message.GetReaderAtBodyContents())
     {
         info = CloseSequence.Create(reader);
         message.ReadFromBodyContentsToEnd(reader);
     }
     info.SetMessageId(messageVersion, headers);
     info.SetReplyTo(messageVersion, headers);
     return info;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:17,代码来源:CloseSequenceInfo.cs

示例4: ReadFrom

 protected static void ReadFrom(Message message, XmlDictionaryString localName, XmlDictionaryString ns)
 {
     if (message.IsEmpty)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(Microsoft.Transactions.SR.GetString("InvalidMessageBody")));
     }
     using (XmlDictionaryReader reader = message.GetReaderAtBodyContents())
     {
         ReadFrom(reader, localName, ns);
         try
         {
             message.ReadFromBodyContentsToEnd(reader);
         }
         catch (XmlException exception)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(Microsoft.Transactions.SR.GetString("InvalidMessageBody"), exception));
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:19,代码来源:NotificationMessage.cs

示例5: ReadMessage

 public static TerminateSequenceResponseInfo ReadMessage(MessageVersion messageVersion, Message message, MessageHeaders headers)
 {
     TerminateSequenceResponseInfo info;
     if (headers.RelatesTo == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageHeaderException(System.ServiceModel.SR.GetString("MissingRelatesToOnWsrmResponseReason", new object[] { DXD.Wsrm11Dictionary.TerminateSequenceResponse }), messageVersion.Addressing.Namespace, "RelatesTo", false));
     }
     if (message.IsEmpty)
     {
         string str = System.ServiceModel.SR.GetString("NonEmptyWsrmMessageIsEmpty", new object[] { WsrmIndex.GetTerminateSequenceResponseActionString(ReliableMessagingVersion.WSReliableMessaging11) });
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(str));
     }
     using (XmlDictionaryReader reader = message.GetReaderAtBodyContents())
     {
         info = TerminateSequenceResponse.Create(reader);
         message.ReadFromBodyContentsToEnd(reader);
     }
     info.relatesTo = headers.RelatesTo;
     return info;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:TerminateSequenceResponseInfo.cs

示例6: ReadMessage

 public static TerminateSequenceInfo ReadMessage(MessageVersion messageVersion, ReliableMessagingVersion reliableMessagingVersion, Message message, MessageHeaders headers)
 {
     TerminateSequenceInfo info;
     if (message.IsEmpty)
     {
         string str = System.ServiceModel.SR.GetString("NonEmptyWsrmMessageIsEmpty", new object[] { WsrmIndex.GetTerminateSequenceActionString(reliableMessagingVersion) });
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(str));
     }
     using (XmlDictionaryReader reader = message.GetReaderAtBodyContents())
     {
         info = TerminateSequence.Create(reliableMessagingVersion, reader);
         message.ReadFromBodyContentsToEnd(reader);
     }
     if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
     {
         info.SetMessageId(messageVersion, headers);
         info.SetReplyTo(messageVersion, headers);
     }
     return info;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:TerminateSequenceInfo.cs

示例7: Register

 public Register(Message message, Microsoft.Transactions.Wsat.Protocol.ProtocolVersion protocolVersion) : this(protocolVersion)
 {
     if (message.IsEmpty)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(Microsoft.Transactions.SR.GetString("InvalidMessageBody")));
     }
     XmlDictionaryReader readerAtBodyContents = message.GetReaderAtBodyContents();
     using (readerAtBodyContents)
     {
         this.ReadFrom(readerAtBodyContents);
         try
         {
             message.ReadFromBodyContentsToEnd(readerAtBodyContents);
         }
         catch (XmlException exception)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidMessageException(Microsoft.Transactions.SR.GetString("InvalidMessageBody"), exception));
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:Register.cs

示例8: ReadMessage

 public static CloseSequenceResponseInfo ReadMessage(MessageVersion messageVersion, Message message, MessageHeaders headers)
 {
     CloseSequenceResponseInfo info;
     if (headers.RelatesTo == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageHeaderException(System.ServiceModel.SR.GetString("MissingRelatesToOnWsrmResponseReason", new object[] { DXD.Wsrm11Dictionary.CloseSequenceResponse }), messageVersion.Addressing.Namespace, "RelatesTo", false));
     }
     if (message.IsEmpty)
     {
         string str = System.ServiceModel.SR.GetString("NonEmptyWsrmMessageIsEmpty", new object[] { "http://docs.oasis-open.org/ws-rx/wsrm/200702/CloseSequenceResponse" });
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(str));
     }
     using (XmlDictionaryReader reader = message.GetReaderAtBodyContents())
     {
         info = CloseSequenceResponse.Create(reader);
         message.ReadFromBodyContentsToEnd(reader);
     }
     info.relatesTo = headers.RelatesTo;
     return info;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:CloseSequenceResponseInfo.cs

示例9: DeserializeReply

        public object DeserializeReply(Message message, object[] parameters)
        {
            if (message == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("message"));
            if (parameters == null)
                throw TraceUtility.ThrowHelperError(new ArgumentNullException("parameters"), message);
            try
            {
                if (message.IsEmpty)
                {
                    if (_responseWrapperName == null)
                        return null;
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SerializationException(SR.SFxInvalidMessageBodyEmptyMessage));
                }

                XmlDictionaryReader bodyReader = message.GetReaderAtBodyContents();
                using (bodyReader)
                {
                    object returnValue = DeserializeResponse(bodyReader, parameters);
                    message.ReadFromBodyContentsToEnd(bodyReader);
                    return returnValue;
                }
            }
            catch (XmlException xe)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CommunicationException(
                    SR.Format(SR.SFxErrorDeserializingReplyBodyMore, _operation.Name, xe.Message), xe));
            }
            catch (FormatException fe)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CommunicationException(
                    SR.Format(SR.SFxErrorDeserializingReplyBodyMore, _operation.Name, fe.Message), fe));
            }
            catch (SerializationException se)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CommunicationException(
                    SR.Format(SR.SFxErrorDeserializingReplyBodyMore, _operation.Name, se.Message), se));
            }
        }
开发者ID:shijiaxing,项目名称:wcf,代码行数:39,代码来源:PrimitiveOperationFormatter.cs

示例10: DeserializeRequest

        public void DeserializeRequest(Message message, object[] parameters)
        {
            if (message == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("message"));
            if (parameters == null)
                throw TraceUtility.ThrowHelperError(new ArgumentNullException("parameters"), message);
            try
            {
                if (message.IsEmpty)
                {
                    if (requestWrapperName == null)
                        return;
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SerializationException(SR.GetString(SR.SFxInvalidMessageBodyEmptyMessage)));
                }

                XmlDictionaryReader bodyReader = message.GetReaderAtBodyContents();
                using (bodyReader)
                {
                    DeserializeRequest(bodyReader, parameters);
                    message.ReadFromBodyContentsToEnd(bodyReader);
                }
            }
            catch (XmlException xe)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
                    OperationFormatter.CreateDeserializationFailedFault(
                        SR.GetString(SR.SFxErrorDeserializingRequestBodyMore, operation.Name, xe.Message), 
                        xe));
            }
            catch (FormatException fe)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
                    OperationFormatter.CreateDeserializationFailedFault(
                        SR.GetString(SR.SFxErrorDeserializingRequestBodyMore, operation.Name, fe.Message), 
                        fe));
            }
            catch (SerializationException se)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CommunicationException(
                    SR.GetString(SR.SFxErrorDeserializingRequestBodyMore, operation.Name, se.Message), 
                    se));
            }
        }
开发者ID:uQr,项目名称:referencesource,代码行数:43,代码来源:PrimitiveOperationFormatter.cs

示例11: ReadMessage

        public static CloseSequenceResponseInfo ReadMessage(MessageVersion messageVersion, Message message,
            MessageHeaders headers)
        {
            if (headers.RelatesTo == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
                    new MessageHeaderException(SR.GetString(SR.MissingRelatesToOnWsrmResponseReason,
                    DXD.Wsrm11Dictionary.CloseSequenceResponse), messageVersion.Addressing.Namespace,
                    AddressingStrings.RelatesTo, false));
            }

            if (message.IsEmpty)
            {
                string reason = SR.GetString(SR.NonEmptyWsrmMessageIsEmpty,
                    Wsrm11Strings.CloseSequenceResponseAction);
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(reason));
            }

            CloseSequenceResponseInfo info;
            using (XmlDictionaryReader reader = message.GetReaderAtBodyContents())
            {
                info = CloseSequenceResponse.Create(reader);
                message.ReadFromBodyContentsToEnd(reader);
            }

            info.relatesTo = headers.RelatesTo;
            return info;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:28,代码来源:WsrmMessageInfo.cs

示例12: DeserializeRequest

 public void DeserializeRequest(Message message, object[] parameters)
 {
     if (message == null)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("message"));
     }
     if (parameters == null)
     {
         throw TraceUtility.ThrowHelperError(new ArgumentNullException("parameters"), message);
     }
     try
     {
         if (message.IsEmpty)
         {
             if (this.requestWrapperName != null)
             {
                 throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SerializationException(System.ServiceModel.SR.GetString("SFxInvalidMessageBodyEmptyMessage")));
             }
         }
         else
         {
             XmlDictionaryReader readerAtBodyContents = message.GetReaderAtBodyContents();
             using (readerAtBodyContents)
             {
                 this.DeserializeRequest(readerAtBodyContents, parameters);
                 message.ReadFromBodyContentsToEnd(readerAtBodyContents);
             }
         }
     }
     catch (XmlException exception)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(OperationFormatter.CreateDeserializationFailedFault(System.ServiceModel.SR.GetString("SFxErrorDeserializingRequestBodyMore", new object[] { this.operation.Name, exception.Message }), exception));
     }
     catch (FormatException exception2)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(OperationFormatter.CreateDeserializationFailedFault(System.ServiceModel.SR.GetString("SFxErrorDeserializingRequestBodyMore", new object[] { this.operation.Name, exception2.Message }), exception2));
     }
     catch (SerializationException exception3)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CommunicationException(System.ServiceModel.SR.GetString("SFxErrorDeserializingRequestBodyMore", new object[] { this.operation.Name, exception3.Message }), exception3));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:42,代码来源:PrimitiveOperationFormatter.cs

示例13: DeserializeReply

 public object DeserializeReply(Message message, object[] parameters)
 {
     object obj3;
     if (message == null)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("message"));
     }
     if (parameters == null)
     {
         throw TraceUtility.ThrowHelperError(new ArgumentNullException("parameters"), message);
     }
     try
     {
         if (message.IsEmpty)
         {
             if (this.responseWrapperName != null)
             {
                 throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SerializationException(System.ServiceModel.SR.GetString("SFxInvalidMessageBodyEmptyMessage")));
             }
             return null;
         }
         XmlDictionaryReader readerAtBodyContents = message.GetReaderAtBodyContents();
         using (readerAtBodyContents)
         {
             object obj2 = this.DeserializeResponse(readerAtBodyContents, parameters);
             message.ReadFromBodyContentsToEnd(readerAtBodyContents);
             obj3 = obj2;
         }
     }
     catch (XmlException exception)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CommunicationException(System.ServiceModel.SR.GetString("SFxErrorDeserializingReplyBodyMore", new object[] { this.operation.Name, exception.Message }), exception));
     }
     catch (FormatException exception2)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CommunicationException(System.ServiceModel.SR.GetString("SFxErrorDeserializingReplyBodyMore", new object[] { this.operation.Name, exception2.Message }), exception2));
     }
     catch (SerializationException exception3)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CommunicationException(System.ServiceModel.SR.GetString("SFxErrorDeserializingReplyBodyMore", new object[] { this.operation.Name, exception3.Message }), exception3));
     }
     return obj3;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:43,代码来源:PrimitiveOperationFormatter.cs


注:本文中的Message.ReadFromBodyContentsToEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。