public static Message CreateMessage(MessageVersion version, string action, string contentType, StreamWriterDelegate writer) { DelegateBodyWriter bodyWriter = new DelegateBodyWriter(writer); Message message = Message.CreateMessage(version, action, bodyWriter); message.Properties.Add(WebBodyFormatMessageProperty.Name, new WebBodyFormatMessageProperty(WebContentFormat.Raw)); HttpResponseMessageProperty response = new HttpResponseMessageProperty(); response.Headers[System.Net.HttpResponseHeader.ContentType] = contentType; message.Properties.Add(HttpResponseMessageProperty.Name, response); return message; }
public static Message CreateMessage(MessageVersion version, string action, string contentType, StreamWriterDelegate writer) { DelegateBodyWriter bodyWriter = new DelegateBodyWriter(writer); Message message = Message.CreateMessage(version, action, bodyWriter); message.Properties.Add(WebBodyFormatMessageProperty.Name, new WebBodyFormatMessageProperty(WebContentFormat.Raw)); HttpResponseMessageProperty response = new HttpResponseMessageProperty(); response.Headers[System.Net.HttpResponseHeader.ContentType] = contentType; message.Properties.Add(HttpResponseMessageProperty.Name, response); return(message); }