• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Channels.Message类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Message类属于System.ServiceModel.Channels命名空间,在下文中一共展示了Message类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SecurityHeader

 public SecurityHeader(System.ServiceModel.Channels.Message message, string actor, bool mustUnderstand, bool relay, SecurityStandardsManager standardsManager, SecurityAlgorithmSuite algorithmSuite, System.ServiceModel.Description.MessageDirection transferDirection)
 {
     if (message == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message");
     }
     if (actor == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("actor");
     }
     if (standardsManager == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("standardsManager");
     }
     if (algorithmSuite == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("algorithmSuite");
     }
     this.message = message;
     this.actor = actor;
     this.mustUnderstand = mustUnderstand;
     this.relay = relay;
     this.standardsManager = standardsManager;
     this.algorithmSuite = algorithmSuite;
     this.transferDirection = transferDirection;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:26,代码来源:SecurityHeader.cs


示例2: BeforeSendRequest

        /// <summary>
        /// Add token message at header to using NHibernate cache
        /// </summary>
        /// <param name="request"></param>
        /// <param name="channel"></param>
        /// <returns></returns>
        public object BeforeSendRequest(ref Message request, IClientChannel channel)
        {
            //get the extension item that the client may have put in the channel
            var item = channel.Extensions.Find<NHibernate2ndLevelCacheBehaviorExtensionItem>();
            bool clientWantsToBypass = (item != null && item.BypassNHibernate2ndLevelCache);

            if (clientWantsToBypass || IsDefaultBypassNHibernateCache)
            {
                MessageHeader<bool> mhg = new MessageHeader<bool>(true);
                MessageHeader untyped = mhg.GetUntypedHeader("token", "ns");
                request.Headers.Add(untyped);
            }

            return null;
        }
开发者ID:VKeCRM,项目名称:V2,代码行数:21,代码来源:NHibernateClientMessageInspector.cs


示例3: ProcessTrustFeb2005ValidateResponse

 /// <summary>
 /// Processes a Trust Feb 2005 RSTR/Validate message synchronously.
 /// </summary>
 /// <param name="message">Incoming Request message.</param>
 /// <returns>Message with the serialized response.</returns>
 public Message ProcessTrustFeb2005ValidateResponse(Message message)
 {
     return ProcessCore(message,
                         _securityTokenServiceConfiguration.WSTrustFeb2005RequestSerializer,
                         _securityTokenServiceConfiguration.WSTrustFeb2005ResponseSerializer,
                         WSTrustFeb2005Constants.Actions.ValidateResponse,
                         WSTrustFeb2005Constants.Actions.ValidateResponse,
                         WSTrustFeb2005Constants.NamespaceURI);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:14,代码来源:WSTrustServiceContract.cs


示例4: ProcessTrust13RenewResponse

 /// <summary>
 /// Processes a Trust 1.3 RSTR/Renew message synchronously.
 /// </summary>
 /// <param name="message">Incoming Request message.</param>
 /// <returns>Message with the serialized response.</returns>
 public Message ProcessTrust13RenewResponse(Message message)
 {
     return ProcessCore(message,
                         _securityTokenServiceConfiguration.WSTrust13RequestSerializer,
                         _securityTokenServiceConfiguration.WSTrust13ResponseSerializer,
                         WSTrust13Constants.Actions.RenewResponse,
                         WSTrust13Constants.Actions.RenewFinalResponse,
                         WSTrust13Constants.NamespaceURI);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:14,代码来源:WSTrustServiceContract.cs


示例5: BeginProcessCore

        /// <summary>
        /// Handles Asynchronous call to the STS.
        /// </summary>
        /// <param name="requestMessage">Incoming Request message.</param>
        /// <param name="requestSerializer">Trust Request Serializer.</param>
        /// <param name="responseSerializer">Trust Response Serializer.</param>
        /// <param name="requestAction">Request SOAP action.</param>
        /// <param name="responseAction">Response SOAP action.</param>
        /// <param name="trustNamespace">Namespace URI of the trust version of the incoming request.</param>
        /// <param name="callback">Callback that gets invoked when the Asynchronous call ends.</param>
        /// <param name="state">state information of the Asynchronous call.</param>
        /// <returns>IAsyncResult that should be passed back to the End method to complete the Asynchronous call.</returns>
        /// <exception cref="ArgumentNullException">One of the argument is null.</exception>
        protected virtual IAsyncResult BeginProcessCore(Message requestMessage, WSTrustRequestSerializer requestSerializer, WSTrustResponseSerializer responseSerializer, string requestAction, string responseAction, string trustNamespace, AsyncCallback callback, object state)
        {
            if (requestMessage == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("request");
            }

            if (requestSerializer == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("requestSerializer");
            }

            if (responseSerializer == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("responseSerializer");
            }

            if (String.IsNullOrEmpty(requestAction))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("requestAction");
            }

            if (String.IsNullOrEmpty(responseAction))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("responseAction");
            }

            if (String.IsNullOrEmpty(trustNamespace))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("trustNamespace");
            }

            IAsyncResult result = null;
            try
            {
                Fx.Assert(OperationContext.Current != null, "");
                Fx.Assert(OperationContext.Current.RequestContext != null, "");

                //
                // Create the Serialization and Dispatch context objects.
                //
                WSTrustSerializationContext serializationContext = CreateSerializationContext();

                DispatchContext dispatchContext = CreateDispatchContext(requestMessage,
                                                                         requestAction,
                                                                         responseAction,
                                                                         trustNamespace,
                                                                         requestSerializer,
                                                                         responseSerializer,
                                                                         serializationContext);

                //
                // Validate the dispatch context.
                //
                ValidateDispatchContext(dispatchContext);

                //
                // Dispatch the message asynchronously.
                //
                result = new ProcessCoreAsyncResult(this,
                                                     dispatchContext,
                                                     OperationContext.Current.RequestContext.RequestMessage.Version,
                                                     responseSerializer,
                                                     serializationContext,
                                                     callback,
                                                     state);
            }
            catch (Exception ex)
            {
                if (!HandleException(ex, trustNamespace, requestAction, requestMessage.Version.Envelope))
                {
                    throw;
                }
            }

            return result;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:90,代码来源:WSTrustServiceContract.cs


示例6: CreateDispatchContext

        /// <summary>
        /// Creates a <see cref="DispatchContext"/> object for use by the <see cref="DispatchRequest"/> method.
        /// </summary>
        /// <param name="requestMessage">The incoming request message.</param>
        /// <param name="requestAction">The SOAP action of the request.</param>
        /// <param name="responseAction">The default SOAP action of the response.</param>
        /// <param name="trustNamespace">Namespace URI of the trust version of the incoming request.</param>
        /// <param name="requestSerializer">The <see cref="WSTrustRequestSerializer"/> used to deserialize 
        /// incoming RST messages.</param>
        /// <param name="responseSerializer">The <see cref="WSTrustResponseSerializer"/> used to deserialize 
        /// incoming RSTR messages.</param>
        /// <param name="serializationContext">The <see cref="WSTrustSerializationContext"/> to use 
        /// when deserializing incoming messages.</param>
        /// <returns>A <see cref="DispatchContext"/> object.</returns>
        protected virtual DispatchContext CreateDispatchContext(Message requestMessage,
                                                                 string requestAction,
                                                                 string responseAction,
                                                                 string trustNamespace,
                                                                 WSTrustRequestSerializer requestSerializer,
                                                                 WSTrustResponseSerializer responseSerializer,
                                                                 WSTrustSerializationContext serializationContext)
        {
            DispatchContext dispatchContext = new DispatchContext()
            {
                Principal = OperationContext.Current.ClaimsPrincipal as ClaimsPrincipal,
                RequestAction = requestAction,
                ResponseAction = responseAction,
                TrustNamespace = trustNamespace
            };

            XmlReader requestBodyReader = requestMessage.GetReaderAtBodyContents();
            //
            // Take a peek at the request with the serializers to figure out if this is a standard incoming
            // RST or if this is an instance of a challenge-response style message pattern where an RSTR comes in.
            //
            if (requestSerializer.CanRead(requestBodyReader))
            {
                dispatchContext.RequestMessage = requestSerializer.ReadXml(requestBodyReader, serializationContext);
            }
            else if (responseSerializer.CanRead(requestBodyReader))
            {
                dispatchContext.RequestMessage = responseSerializer.ReadXml(requestBodyReader, serializationContext);
            }
            else
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
                    new InvalidRequestException(SR.GetString(SR.ID3114)));
            }

            //
            // CAUTION: Don't create the STS until after the RST or RSTR is deserialized or the test team
            //          has major infrastructure problems.
            //          
            dispatchContext.SecurityTokenService = CreateSTS();
            return dispatchContext;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:56,代码来源:WSTrustServiceContract.cs


示例7: ProcessCore

        /// <summary>
        /// Handles Synchronous calls to the STS.
        /// </summary>
        /// <param name="requestMessage">Incoming Request message.</param>
        /// <param name="requestSerializer">Trust Request Serializer.</param>
        /// <param name="responseSerializer">Trust Response Serializer.</param>
        /// <param name="requestAction">Request SOAP action.</param>
        /// <param name="responseAction">Response SOAP action.</param>
        /// <param name="trustNamespace">Namespace URI of the trust version of the incoming request.</param>
        /// <returns>Response message that contains the serialized RSTR.</returns>
        /// <exception cref="ArgumentNullException">One of the argument is null.</exception>
        protected virtual Message ProcessCore(Message requestMessage, WSTrustRequestSerializer requestSerializer, WSTrustResponseSerializer responseSerializer, string requestAction, string responseAction, string trustNamespace)
        {
            if (requestMessage == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("requestMessage");
            }

            if (requestSerializer == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("requestSerializer");
            }

            if (responseSerializer == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("responseSerializer");
            }

            if (String.IsNullOrEmpty(requestAction))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("requestAction");
            }

            if (String.IsNullOrEmpty(responseAction))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("responseAction");
            }

            if (String.IsNullOrEmpty(trustNamespace))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("trustNamespace");
            }

            Message response = null;
            try
            {
                Fx.Assert(OperationContext.Current != null, "");
                Fx.Assert(OperationContext.Current.RequestContext != null, "");

                //
                // Create the Serialization and Dispatch context objects.
                //
                WSTrustSerializationContext serializationContext = CreateSerializationContext();

                DispatchContext dispatchContext = CreateDispatchContext(requestMessage,
                                                                         requestAction,
                                                                         responseAction,
                                                                         trustNamespace,
                                                                         requestSerializer,
                                                                         responseSerializer,
                                                                         serializationContext);

                //
                // Validate the dispatch context.
                //
                ValidateDispatchContext(dispatchContext);

                //
                // Dispatch the STS message.
                //
                DispatchRequest(dispatchContext);

                //
                // Create the response Message object with the appropriate action.
                //
                response = Message.CreateMessage(OperationContext.Current.RequestContext.RequestMessage.Version,
                                                  dispatchContext.ResponseAction,
                                                  new WSTrustResponseBodyWriter(dispatchContext.ResponseMessage, responseSerializer, serializationContext));
            }
            catch (Exception ex)
            {
                if (!HandleException(ex, trustNamespace, requestAction, requestMessage.Version.Envelope))
                {
                    throw;
                }
            }

            return response;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:89,代码来源:WSTrustServiceContract.cs


示例8: MessageTraceRecord

 internal MessageTraceRecord(System.ServiceModel.Channels.Message message)
 {
     this.message = message;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:MessageTraceRecord.cs


示例9: Foo

		public void Foo (SMMessage msg, string s)
		{
		}
开发者ID:nlhepler,项目名称:mono,代码行数:3,代码来源:WsdlExporterTest.cs


示例10: AfterReceiveReply

 public void AfterReceiveReply(ref Message reply, object correlationState)
 {
 }
开发者ID:VKeCRM,项目名称:V2,代码行数:3,代码来源:NHibernateClientMessageInspector.cs


示例11: AsyncMetadataReferenceRetriever

 internal AsyncMetadataReferenceRetriever(IMetadataExchange metadataClient, MessageVersion messageVersion, TimeoutHelper timeoutHelper, AsyncCallback callback, object state) : base(callback, state)
 {
     this.message = MetadataExchangeClient.MetadataReferenceRetriever.CreateGetMessage(messageVersion);
     ((IClientChannel) metadataClient).OperationTimeout = timeoutHelper.RemainingTime();
     IAsyncResult result = metadataClient.BeginGet(this.message, Fx.ThunkCallback(new AsyncCallback(this.RequestCallback)), metadataClient);
     if (result.CompletedSynchronously)
     {
         this.HandleResult(result);
         base.Complete(true);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:MetadataExchangeClient.cs


示例12: Get

		public static MsmqIntegrationMessageProperty Get (SMessage message)
		{
			throw new NotImplementedException ();
		}
开发者ID:nickchal,项目名称:pash,代码行数:4,代码来源:MsmqIntegrationMessageProperty.cs


示例13: Get

			public SMMessage Get (SMMessage req) {
				return null;
			}
开发者ID:nickchal,项目名称:pash,代码行数:3,代码来源:EndpointDispatcherTest.cs


示例14: BeginTrust13Validate

 /// <summary>
 /// Processes an Asynchronous call to Trust 1.3 Validate message.
 /// </summary>
 /// <param name="request">Incoming Request message.</param>
 /// <param name="callback">Callback to be invoked when the Asynchronous operation ends.</param>
 /// <param name="state">Asynchronous state.</param>
 /// <returns>IAsyncResult that should be passed back to the End method to complete the Asynchronous call.</returns>
 public IAsyncResult BeginTrust13Validate(Message request, AsyncCallback callback, object state)
 {
     return BeginProcessCore(request, _securityTokenServiceConfiguration.WSTrust13RequestSerializer, _securityTokenServiceConfiguration.WSTrust13ResponseSerializer, WSTrust13Constants.Actions.Validate, WSTrust13Constants.Actions.ValidateFinalResponse, WSTrust13Constants.NamespaceURI, callback, state);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:11,代码来源:WSTrustServiceContract.cs


示例15: Init

 internal void Init(System.ServiceModel.Channels.Message msg, int countMax, XmlSpace space, bool includeBody, bool atomize)
 {
     this.counter = this;
     this.nodeCount = countMax;
     this.nodeCountMax = countMax;
     this.dom = this;
     this.location = 1;
     this.specialParent = 0;
     this.includeBody = includeBody;
     this.message = msg;
     this.headers = msg.Headers;
     this.space = space;
     this.atomize = false;
     int num = (msg.Headers.Count + 6) + 1;
     if ((this.nodes == null) || (this.nodes.Length < num))
     {
         this.nodes = new Node[num + 50];
     }
     else
     {
         Array.Clear(this.nodes, 1, this.nextFreeIndex - 1);
     }
     this.bodyIndex = num - 1;
     this.nextFreeIndex = num;
     Array.Copy(BlankDom, this.nodes, 6);
     string str = msg.Version.Envelope.Namespace;
     this.nodes[2].ns = str;
     this.nodes[3].val = str;
     this.nodes[5].ns = str;
     this.nodes[5].nextSibling = this.bodyIndex;
     this.nodes[5].firstChild = (this.bodyIndex != 6) ? 6 : 0;
     if (msg.Headers.Count > 0)
     {
         int index = 6;
         for (int i = 0; i < msg.Headers.Count; i++)
         {
             this.nodes[index].type = XPathNodeType.Element;
             this.nodes[index].parent = 5;
             this.nodes[index].nextSibling = index + 1;
             this.nodes[index].prevSibling = index - 1;
             MessageHeaderInfo info = msg.Headers[i];
             this.nodes[index].ns = info.Namespace;
             this.nodes[index].name = info.Name;
             this.nodes[index].firstChild = -1;
             index++;
         }
         this.nodes[6].prevSibling = 0;
         this.nodes[this.bodyIndex - 1].nextSibling = 0;
     }
     this.nodes[this.bodyIndex].type = XPathNodeType.Element;
     this.nodes[this.bodyIndex].prefix = "s";
     this.nodes[this.bodyIndex].ns = str;
     this.nodes[this.bodyIndex].name = "Body";
     this.nodes[this.bodyIndex].parent = 2;
     this.nodes[this.bodyIndex].prevSibling = 5;
     this.nodes[this.bodyIndex].firstNamespace = 3;
     this.nodes[this.bodyIndex].firstChild = -1;
     if (atomize)
     {
         this.Atomize();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:62,代码来源:SeekableMessageNavigator.cs


示例16: GetMessageEnvelope

		public string GetMessageEnvelope(Message msg)
		{
			var sb = new StringBuilder();
			using (var sw = XmlWriter.Create(new StringWriter(sb)))
			{
				msg.WriteMessage(sw);
				sw.Flush();
				return sb.ToString();
			}
		}
开发者ID:AVee,项目名称:ServiceStack,代码行数:10,代码来源:MessageSerializationTests.cs


示例17: BeginTrustFeb2005Renew

 /// <summary>
 /// Processes an Asynchronous call to Trust Feb 2005 Renew message.
 /// </summary>
 /// <param name="request">Incoming Request message.</param>
 /// <param name="callback">Callback to be invoked when the Asynchronous operation ends.</param>
 /// <param name="state">Asynchronous state.</param>
 /// <returns>IAsyncResult that should be passed back to the End method to complete the Asynchronous call.</returns>
 public IAsyncResult BeginTrustFeb2005Renew(Message request, AsyncCallback callback, object state)
 {
     return BeginProcessCore(request, _securityTokenServiceConfiguration.WSTrustFeb2005RequestSerializer, _securityTokenServiceConfiguration.WSTrustFeb2005ResponseSerializer, WSTrustFeb2005Constants.Actions.Renew, WSTrustFeb2005Constants.Actions.RenewResponse, WSTrustFeb2005Constants.NamespaceURI, callback, state);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:11,代码来源:WSTrustServiceContract.cs


示例18: UnknownMessageReceivedEventArgs

 internal UnknownMessageReceivedEventArgs(System.ServiceModel.Channels.Message message)
 {
     this.message = message;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:UnknownMessageReceivedEventArgs.cs


示例19: GetInstance

 public object GetInstance(InstanceContext instanceContext, Message message)
 {
     return new ChatService(_userRepository, _messageRepository);
 }
开发者ID:AntonLapshin,项目名称:csharp,代码行数:4,代码来源:ChatInstanceProvider.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Channels.MessageVersion类代码示例发布时间:2022-05-26
下一篇:
C# Channels.HttpResponseMessageProperty类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap