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


C# ICommunicationContext.FetchHeaders方法代码示例

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


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

示例1: ProcessRequest

        public override void ProcessRequest(ICommunicationContext ctx)
        {
            var postDataListID = GetDataListID(ctx);
            if(postDataListID != null)
            {
                new WebPostRequestHandler().ProcessRequest(ctx);
                return;
            }

            var serviceName = GetServiceName(ctx);
            var workspaceID = GetWorkspaceID(ctx);

            var requestTO = new WebRequestTO { ServiceName = serviceName, WebServerUrl = ctx.Request.Uri.ToString(), Dev2WebServer = String.Format("{0}://{1}", ctx.Request.Uri.Scheme, ctx.Request.Uri.Authority) };
            var data = GetPostData(ctx);

            if(!String.IsNullOrEmpty(data))
            {
                requestTO.RawRequestPayload = data;
            }
            var variables = ctx.Request.BoundVariables;
            if(variables != null)
            {
                foreach(string key in variables)
                {
                    requestTO.Variables.Add(key, variables[key]);
                }
            }
            // Execute in its own thread to give proper context ;)
            Thread.CurrentPrincipal = ctx.Request.User;

            var responseWriter = CreateForm(requestTO, serviceName, workspaceID, ctx.FetchHeaders());
            ctx.Send(responseWriter);
        }
开发者ID:ndubul,项目名称:Chillas,代码行数:33,代码来源:WebGetRequestHandler.cs

示例2: ProcessRequest

        public override void ProcessRequest(ICommunicationContext ctx)
        {
            var serviceName = GetServiceName(ctx);
            var instanceId = GetInstanceID(ctx);
            var bookmark = GetBookmark(ctx);
            var postDataListID = GetDataListID(ctx);
            var workspaceID = GetWorkspaceID(ctx);

            var requestTO = new WebRequestTO();
            var xml = GetPostData(ctx, postDataListID);

            if(!String.IsNullOrEmpty(xml))
            {
                requestTO.RawRequestPayload = xml;
            }

            requestTO.ServiceName = serviceName;
            requestTO.InstanceID = instanceId;
            requestTO.Bookmark = bookmark;
            requestTO.WebServerUrl = ctx.Request.Uri.ToString();
            requestTO.Dev2WebServer = String.Format("{0}://{1}", ctx.Request.Uri.Scheme, ctx.Request.Uri.Authority);


            // Execute in its own thread to give proper context ;)
            Thread.CurrentPrincipal = ctx.Request.User;

            var responseWriter = CreateForm(requestTO, serviceName, workspaceID, ctx.FetchHeaders(), PublicFormats, ctx.Request.User);
            ctx.Send(responseWriter);

        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:30,代码来源:WebPostRequestHandler.cs

示例3: ProcessRequest

        public override void ProcessRequest(ICommunicationContext ctx)
        {
            var serviceName = GetServiceName(ctx);
            var instanceId = GetInstanceID(ctx);
            var bookmark = GetBookmark(ctx);
            GetDataListID(ctx);
            var workspaceID = GetWorkspaceID(ctx);
            var formData = new WebRequestTO();

            var xml = GetPostData(ctx);

            if(!String.IsNullOrEmpty(xml))
            {
                formData.RawRequestPayload = xml;
            }

            formData.ServiceName = serviceName;
            formData.InstanceID = instanceId;
            formData.Bookmark = bookmark;
            formData.WebServerUrl = ctx.Request.Uri.ToString();
            formData.Dev2WebServer = String.Format("{0}://{1}", ctx.Request.Uri.Scheme, ctx.Request.Uri.Authority);

            if(ExecutingUser == null)
            {
                throw new Exception("Null Executing User");
            }

            try
            {
                // Execute in its own thread to give proper context ;)
                var t = new Thread(() =>
                {
                    Thread.CurrentPrincipal = ExecutingUser;

                    var responseWriter = CreateForm(formData, serviceName, workspaceID, ctx.FetchHeaders(),ctx.Request.User);
                    ctx.Send(responseWriter);
                });

                t.Start();

                t.Join();
            }
            catch(Exception e)
            {
                // ReSharper disable InvokeAsExtensionMethod
                Dev2Logger.Log.Error(this, e);
                // ReSharper restore InvokeAsExtensionMethod
            }
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:49,代码来源:InternalServiceRequestHandler.cs


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