public HttpResponseMessage DoAction() { dataBus.SetCommonHeaders(); //Set additional headers Dictionary <string, string> additionalHeaders = BuildHeaders(); foreach (KeyValuePair <string, string> keyValuePair in additionalHeaders) { dataBus.HttpRequest.CommonHeaders[keyValuePair.Key] = keyValuePair.Value; } dataBus.HttpRequest.CommonHeaders["SOAPAction"] = "\"" + soapAction + "\""; byte[] message = BuildMessage(); byte[] convertedData = ConvertRequestMessage(message); dataBus.Send(convertedData); //Store it for latter use. responseMessage = dataBus.Receive(); //Dispose the stream //dataBus.HttpRequest.Dispose(); return(responseMessage); }