private void InsertSoapEnvelopeIntoWebRequest(XDocument soapEnvelopeXml) { using (var stream = WebRequestSource.GetRequestStream()) { soapEnvelopeXml.Save(stream); } }
public HttpResponse PostRequest(string data, string contentType) { WebRequestSource.Method = "POST"; WebRequestSource.ContentType = contentType; using (var dataStream = new StreamWriter(WebRequestSource.GetRequestStream())) { dataStream.Write(data); dataStream.Flush(); } return(Request()); }