How to rewrite MSXML2.serverXMLHTTP with System.xml RRS feed

  • Question

  • User1416033902 posted

    Hi all,

    How can I rewrite this VBA code with System.xml in .NEt

    'Create Constants
      Set d_objxmlHttp = CreateObject("MSXML2.serverXMLHTTP")
      Call d_objxmlHttp.Open("POST", sc_url, False)
      Call d_objxmlHttp.setRequestHeader("Content-Type", "text/xml")
      Call d_objxmlHttp.setRequestHeader("SOAPAction", sc_url)
      d_stringSoapMsg = MySOAPXMLString(sc_user, sc_pass, sc_org, sc_tenant, sc_Var)
      d_objxmlHttp.send (d_stringSoapMsg)
      SOAPCall = d_objxmlHttp.responseXML.XML

    Thursday, March 20, 2014 5:44 PM


  • User-1131976214 posted

    First you need to add reference to Microsoft Xml 3.0:
    1 Please right click on your project and select Add Reference
    2 Select the COM tab
    3 Add Reference to Microsoft Xml 3.0.
    Then You can try to use the following code:

         string url="http://xxxx.aspx?user==sa&& password==xx";
         MSXML2.ServerXMLHTTP objHttp = new MSXML2.ServerXMLHTTP();
         objHttp.setRequestHeader("Context-Type", "text/xml");
         objHttp.open("POST", url, false);
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 24, 2014 1:53 AM

All replies