I was recently tasked with upgrading a classic ASP web application to C #. Everything was fine, except that there is code that uses Server.CreateObject("Msxml2.ServerXMLHTTP.3.0") . I donβt even know what it is, except that I have a general idea that it is sometimes used to call a web service via HTTPS.
The code is as follows:
Dim strSOAPEnvelope strSOAPEnvelope = "<?xml version='1.0' encoding='utf-8'?>" & _ "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" & _ "<soap:Body>..........</soap:Body>" & _ "</soap:Envelope>" oXMLHttp.Open "POST", "https://example.com/service.asmx", False oXMLHttp.setRequestHeader "Content-Type", "text/xml" oXMLHttp.setOption 2, 13056 oXMLHttp.setRequestHeader "Connection", "close" oXMLHttp.setRequestHeader "SOAPAction", "https://example.com" & strfunction
I think that I understand the general opinion that this is communication with a web service via HTTPS. How do I upgrade to this code to C #
source share