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


C# RequestHeader类代码示例

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


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

示例1: Get

 private static string Get(RequestHeader requestHeader)
 {
     var name = RequestHeaders[requestHeader];
     if (HttpContext.Current == null || !HttpContext.Current.Items.Contains(name))
         return null;
     var value =  HttpContext.Current.Items[name];
     return value == null ? null : value.ToString();
 }
开发者ID:Guaranteed-Rate,项目名称:Net.RequestStiching,代码行数:8,代码来源:RequestContext.cs

示例2: RequestPackage

		public RequestPackage(RequestHeader header, byte[] data)
		{
			if (header == null) throw new ArgumentNullException("header");
			if (data == null) throw new ArgumentNullException("data");
			if (data.Length == 0) throw new ArgumentOutOfRangeException("data");

			this.Header = header;
			this.Data = data;
		}
开发者ID:ppetrov,项目名称:iFSA.Service,代码行数:9,代码来源:RequestPackage.cs

示例3: Read

        public RequestBody Read(NetworkStream connection, RequestHeader header)
        {
            var encoding = Encoding.GetEncoding(header.GetContentEncoding());
            var requestReader = new StreamReader(connection, encoding);

            var body = new char[header.GetContentLength()];
            requestReader.Read(body, 0, header.GetContentLength());

            return new RequestBody(body);
        }
开发者ID:camswords,项目名称:custom-soap-webservice,代码行数:10,代码来源:HttpRequestBodyReader.cs

示例4: Nsi

        public Nsi()
        {
            //fixture.Customizations.Add(new TypeRelay(typeof(XmlNode),typeof(Helper)));
            //fixture.Customizations.Add(new TypeRelay(typeof(XmlResolver),typeof(Resolver)));
            //fixture.Customize(new AutoConfiguredMoqCustomization());
            header = new RequestHeader
            {
                MessageGUID = Guid.NewGuid().ToString(),
                Date = DateTime.Now,
                SenderID = "fake service"
            };

        }
开发者ID:moskvitin,项目名称:RTK.HCS,代码行数:13,代码来源:hcs-nsi.svc.cs

示例5: StitchRequestHeader

        private string StitchRequestHeader(HttpRequestMessage request, RequestHeader requestHeader)
        {
            string value = null;
            var name = RequestContext.RequestHeaders[requestHeader];

            if (request.Headers.Contains(name))
                value = request.Headers.GetValues(name).First();
            else if (_generateIfMissing)
                value = Guid.NewGuid().ToString();
            else
                _errors.Add(string.Format("{0} is missing from the request", name));

            RequestContext.Set(requestHeader, value);

            return value;
        }
开发者ID:Guaranteed-Rate,项目名称:Net.RequestStiching,代码行数:16,代码来源:RequestStitchingMessageHandler.cs

示例6: Main

        static void Main(string[] args)
        {
            Console.WriteLine("Client starting....");
            using (NsiClient client = new NsiClient())
            {
                var header = new RequestHeader();
                var request = new exportNsiListRequest();
                var result = client.exportNsiList(ref header, request);
                Console.WriteLine("result id is {0}", result.Id);
            }

            using (RegOrgPortsTypeClient client1 = new RegOrgPortsTypeClient())
            {
                //will be implemented later
            }

            Console.WriteLine("Client will be terminated.");
            Console.ReadKey();
        }
开发者ID:moskvitin,项目名称:RTK.HCS,代码行数:19,代码来源:Program.cs

示例7: Main

		static void Main(string[] args)
		{
			Console.ReadLine();
			Console.WriteLine(@"Upload video");
			using (var client = new TcpClient(@"127.0.0.1", 11111))
			{
				var handler = new TransferHandler(client.GetStream(), new byte[16 * 1024]);

				//var config = new LogConfig(new RequestHeader(ClientPlatform.WinMobile, new Version(0, 0, 0, 0), string.Empty, string.Empty), Category.Logs, @"C:\Temp\");
				//new LogsClientHandler(2, handler).ConfigureAsync(config).Wait();

				var path = @"C:\Users\bg900343\Desktop\DEV-B318.wmv";
				var clientFile = new ClientFile(Path.GetFileName(path), File.ReadAllBytes(path));
				var requestHeader = new RequestHeader(ClientPlatform.WinMobile, new Version(0, 0, 0, 0), string.Empty, string.Empty);
				new LogsClientHandler(2, handler).UploadFilesAsync(requestHeader, new List<ClientFile> { clientFile }).Wait();

				handler.CloseAsync().Wait();
			}
			Console.WriteLine(@"Done");
			Console.ReadLine();
		}
开发者ID:ppetrov,项目名称:iFSA.Service,代码行数:21,代码来源:Program.cs

示例8: OperationContext

        /// <summary>
        /// Initializes the context with a session.
        /// </summary>
        /// <param name="requestHeader">The request header.</param>
        /// <param name="requestType">Type of the request.</param>
        public OperationContext(RequestHeader requestHeader, RequestType requestType)
        {
            if (requestHeader == null) throw new ArgumentNullException("requestHeader");
            
            m_channelContext    = SecureChannelContext.Current;
            m_session           = null;
            m_identity          = null;
            m_preferredLocales  = new string[0];
            m_diagnosticsMask   = (DiagnosticsMasks)requestHeader.ReturnDiagnostics;
            m_stringTable       = new StringTable();
            m_auditLogEntryId   = requestHeader.AuditEntryId;
            m_requestId         = Utils.IncrementIdentifier(ref s_lastRequestId);
            m_requestType       = requestType;
            m_clientHandle      = requestHeader.RequestHandle;
            m_operationDeadline = DateTime.MaxValue;

            if (requestHeader.TimeoutHint > 0)
            {
                m_operationDeadline = DateTime.UtcNow.AddMilliseconds(requestHeader.TimeoutHint);
            }
        }
开发者ID:yuriik83,项目名称:UA-.UWP-Universal-Windows-Platform,代码行数:26,代码来源:OperationContext.cs

示例9: ConfigureFolderTapped

		private async void ConfigureFolderTapped(object sender, TappedRoutedEventArgs e)
		{
			var btn = (sender as Button);
			if (btn != null)
			{
				var ctx = btn.DataContext as LogCategoryViewModel;
				if (ctx != null)
				{
					btn.IsEnabled = false;

					try
					{
						var path = Path.Combine(new[] { @"C:\Temp\", ctx.Platform.ToString(), ctx.Category.ToString() });

						using (var socket = new StreamSocket())
						{
							await socket.ConnectAsync(new HostName(@"127.0.0.1"), @"11111");

							var handler = new WinRtTransferHandler(socket);
							var requestHeader = new RequestHeader(ctx.Platform, new Version(0, 0, 0, 0), string.Empty, string.Empty);
							var config = new LogConfig(requestHeader, ctx.Category, path);
							await new LogsClientHandler(2, handler).ConfigureAsync(config);

							await handler.CloseAsync();
						}

						ctx.Path = path;
					}
					catch
					{
					}
					finally
					{
						btn.IsEnabled = true;
					}
				}
			}
		}
开发者ID:ppetrov,项目名称:iFSA.Service,代码行数:38,代码来源:DashboardScreen.xaml.cs

示例10: HistoryUpdate

        /// <summary>
        /// Invokes the HistoryUpdate service.
        /// </summary>
        public virtual ResponseHeader HistoryUpdate(
            RequestHeader                     requestHeader,
            ExtensionObjectCollection         historyUpdateDetails,
            out HistoryUpdateResultCollection results,
            out DiagnosticInfoCollection      diagnosticInfos)
        {
            results = null;
            diagnosticInfos = null;

            ValidateRequest(requestHeader);

            // Insert implementation.

            return CreateResponse(requestHeader, StatusCodes.BadServiceUnsupported);
        }
开发者ID:OPCFoundation,项目名称:Misc-Tools,代码行数:18,代码来源:Opc.Ua.ServerBase.cs

示例11: HistoryRead

        /// <summary>
        /// Invokes the HistoryRead service.
        /// </summary>
        public virtual ResponseHeader HistoryRead(
            RequestHeader                   requestHeader,
            ExtensionObject                 historyReadDetails,
            TimestampsToReturn              timestampsToReturn,
            bool                            releaseContinuationPoints,
            HistoryReadValueIdCollection    nodesToRead,
            out HistoryReadResultCollection results,
            out DiagnosticInfoCollection    diagnosticInfos)
        {
            results = null;
            diagnosticInfos = null;

            ValidateRequest(requestHeader);

            // Insert implementation.

            return CreateResponse(requestHeader, StatusCodes.BadServiceUnsupported);
        }
开发者ID:OPCFoundation,项目名称:Misc-Tools,代码行数:21,代码来源:Opc.Ua.ServerBase.cs

示例12: QueryNext

        /// <summary>
        /// Invokes the QueryNext service.
        /// </summary>
        public virtual ResponseHeader QueryNext(
            RequestHeader              requestHeader,
            bool                       releaseContinuationPoint,
            byte[]                     continuationPoint,
            out QueryDataSetCollection queryDataSets,
            out byte[]                 revisedContinuationPoint)
        {
            queryDataSets = null;
            revisedContinuationPoint = null;

            ValidateRequest(requestHeader);

            // Insert implementation.

            return CreateResponse(requestHeader, StatusCodes.BadServiceUnsupported);
        }
开发者ID:OPCFoundation,项目名称:Misc-Tools,代码行数:19,代码来源:Opc.Ua.ServerBase.cs

示例13: UnregisterNodes

        /// <summary>
        /// Invokes the UnregisterNodes service.
        /// </summary>
        public virtual ResponseHeader UnregisterNodes(
            RequestHeader    requestHeader,
            NodeIdCollection nodesToUnregister)
        {

            ValidateRequest(requestHeader);

            // Insert implementation.

            return CreateResponse(requestHeader, StatusCodes.BadServiceUnsupported);
        }
开发者ID:OPCFoundation,项目名称:Misc-Tools,代码行数:14,代码来源:Opc.Ua.ServerBase.cs

示例14: BrowseNext

        /// <summary>
        /// Invokes the BrowseNext service.
        /// </summary>
        public virtual ResponseHeader BrowseNext(
            RequestHeader                requestHeader,
            bool                         releaseContinuationPoints,
            ByteStringCollection         continuationPoints,
            out BrowseResultCollection   results,
            out DiagnosticInfoCollection diagnosticInfos)
        {
            results = null;
            diagnosticInfos = null;

            ValidateRequest(requestHeader);

            // Insert implementation.

            return CreateResponse(requestHeader, StatusCodes.BadServiceUnsupported);
        }
开发者ID:OPCFoundation,项目名称:Misc-Tools,代码行数:19,代码来源:Opc.Ua.ServerBase.cs

示例15: DeleteReferences

        /// <summary>
        /// Invokes the DeleteReferences service.
        /// </summary>
        public virtual ResponseHeader DeleteReferences(
            RequestHeader                  requestHeader,
            DeleteReferencesItemCollection referencesToDelete,
            out StatusCodeCollection       results,
            out DiagnosticInfoCollection   diagnosticInfos)
        {
            results = null;
            diagnosticInfos = null;

            ValidateRequest(requestHeader);

            // Insert implementation.

            return CreateResponse(requestHeader, StatusCodes.BadServiceUnsupported);
        }
开发者ID:OPCFoundation,项目名称:Misc-Tools,代码行数:18,代码来源:Opc.Ua.ServerBase.cs


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