private Message PrepareReply(Message message) { string str; if (message == null) { return(this.CreateAckMessage(HttpStatusCode.Accepted, string.Empty)); } if (!this.isSoapRequest) { if (message.Headers.Action == null) { str = (this.requestAction == null ? string.Empty : string.Concat(this.requestAction, "Response")); } else { str = string.Concat(message.Headers.Action, "Response"); } return(RelayedHttpUtility.ConvertWebResponseToSoapResponse(message, str)); } if (this.encoder.MessageVersion.Addressing == AddressingVersion.None) { message.Headers.Action = null; message.Headers.To = null; message.Headers.ReplyTo = null; message.Headers.From = null; message.Headers.FaultTo = null; message.Headers.MessageId = null; message.Headers.RelatesTo = null; } return(message.ConvertSoapResponseToWrappedSoapResponse(message.Headers.Action, this.wrapper)); }
private Message CreateAckMessage(HttpStatusCode statusCode, string statusDescription) { Message message = Message.CreateMessage(MessageVersion.None, ""); HttpResponseMessageProperty httpResponseMessageProperty = new HttpResponseMessageProperty() { StatusCode = statusCode, SuppressEntityBody = true }; if (statusDescription.Length > 0) { httpResponseMessageProperty.StatusDescription = statusDescription; } message.Properties.Add(HttpResponseMessageProperty.Name, httpResponseMessageProperty); return(RelayedHttpUtility.ConvertWebResponseToSoapResponse(message, string.Concat(this.requestAction, "Response"))); }