MSXML2.XMLHTTP exception occurred

Posted on 2006-03-19
Last Modified: 2008-03-17

We are using the MSXML2.XMLHTTP component to send xml via post to a parent website and retreive results back. This gets called hundreds to thousands times a day.
The code works great for a while, but about once a week, sometimes two weeks the MSXML2.XMLHTTP object seems to shut down and fails on the .send call

The exact error is - An exception occurred: 'objXMLhttp.send'

Here is the code -

Public Function GetResponse
      gXML = "<?xml version=""1.0"" encoding=""UTF-8""?>"&gXML
      Set objXMLhttp = server.Createobject("MSXML2.XMLHTTP")
      objXMLhttp.Open "POST", "http://url" ,False
      objXMLhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
      objXMLhttp.send gXML
      GetResponse = objXMLhttp.responsetext

End Function

It is very hard to troubleshoot and it only seems to happen on our live server, and when it does we dont have time to test and troubleshoot so we usually just restart the server, which always fixes the problem.

I have done alot of searches on google and this seems to be a common problem, have found alot of similar cases but no answer as to why the object will be fine for a while then suddenly stop working across the board and throw the above error.

Any ideas?

Thanks in advance :)

Question by:Fracture
    LVL 52

    Expert Comment

    by:Carl Tawn
    This is a common issue. We have found that switching to MSXML2.ServerXMLHTTP is more reliable.

    Author Comment


    Hi Carl,

    Thanks for your reply, gives me alot of relief that MSXML2.ServerXMLHTTP is more reliable. Before we change this over, in your experience are there any significant differences between the two components, ie. are all their properties/methods the same?


    LVL 52

    Accepted Solution

    As far as I am aware they are. I'm not sure of the specifics of the differences albeit that the ServerXMLHTTP seems to be the Server specific version of the XMLHTTP object. I don't know if that is official, but its seems about right, and makes sense.

    I can't say 100% it will fix your problem, but we had a similar issue woth our code base and the switch sorted it for us.

    Author Comment

    Hey Carl,

    Thanks heaps for your responses on this, will move over to the server component and see how we go.

    Kind Regards,


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now