private HttpWebRequest CreateSOAPWebRequest() { //Making Web Request HttpWebRequest Req = (HttpWebRequest)WebRequest.Create(RequestUri); //SOAPAction Req.Headers.Add($@"SOAPAction:{SoapAction}"); //Content_type Req.ContentType = "text/xml;charset=\"utf-8\""; Req.Accept = "text/xml"; //HTTP method Req.Method = "POST"; if (RequestUri.Contains("https")) { Req.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true; } //return HttpWebRequest return(Req); }