Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 958
  • Last Modified:

What is the .NET replacement for ServerXMLHTTP, MSXML2?

I am trying to use a vendor web service.  They sent me sample code that looks like the following:

 Dim oXmlhttp As XMLHTTP30
 Dim sResponse As String
 Set oXmlhttp = New ServerXMLHTTP
 oXmlhttp.setOption(2) = 13056
 oXmlhttp.Open "POST","https://www.myvendorwebservice.com/webservices/RequestHandler.aspx", False, "UserID", "Password"
 oXmlhttp.setRequestHeader "Content-Type", "text/xml"
 oXmlhttp.send oXMLDom.Xml

How do I do the equivalent in .NET?
  • 2
1 Solution
You don't need a replacement here.

You need to add a reference to the com or assembly dll which contains the definition and implementation of
XMLHTTP30 and ServerXMLHTTP in your project, then you can use the same code.
Here is what you need to do:

In .net, choose menu Project->Add Reference,
then browse to directory c:/windows/system32, double click on msxml3.dll and click OK.

Now you can call Set oXmlhttp = New MSXML2.ServerXMLHTTP
Or you add Imports MSXML2 at the top of the code then you can call just Set oXmlhttp = New ServerXMLHTTP

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now