Ejemplo n.º 1
0
        void HandleHttpGet(RequestContext context)
        {
            Message message = new HtmlMessage(
                context.RequestMessage.Version,
                context.RequestMessage.Headers.ReplyTo.ToString(),
                HelloWorldService.ServiceName,
                HelloWorldService.OperationName);

            HttpResponseMessageProperty responseProperty = new HttpResponseMessageProperty();

            responseProperty.StatusCode = HttpStatusCode.OK;
            HttpRequestMessageProperty requestProperty = (HttpRequestMessageProperty)context.RequestMessage.Properties[HttpRequestMessageProperty.Name];

            responseProperty.Headers.Add(HttpResponseHeader.ContentType, requestProperty.Headers[HttpRequestHeader.ContentType]);

            message.Properties.Add(HttpResponseMessageProperty.Name, responseProperty);

            context.Reply(message);
        }
Ejemplo n.º 2
0
        void HandleHttpGet(RequestContext context)
        {
            Message message = new HtmlMessage(
                context.RequestMessage.Version,
                context.RequestMessage.Headers.ReplyTo.ToString(),
                HelloWorldService.ServiceName,
                HelloWorldService.OperationName);

            HttpResponseMessageProperty responseProperty = new HttpResponseMessageProperty();
            responseProperty.StatusCode = HttpStatusCode.OK;
            HttpRequestMessageProperty requestProperty = (HttpRequestMessageProperty)context.RequestMessage.Properties[HttpRequestMessageProperty.Name];
            responseProperty.Headers.Add(HttpResponseHeader.ContentType, requestProperty.Headers[HttpRequestHeader.ContentType]);
            
            message.Properties.Add(HttpResponseMessageProperty.Name, responseProperty);

            context.Reply(message);
        }