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

MSXML2.XMLHTTP exception occurred

Hi,

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 :)

Fracture
0
Fracture
Asked:
Fracture
  • 2
  • 2
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
This is a common issue. We have found that switching to MSXML2.ServerXMLHTTP is more reliable.
0
 
FractureAuthor Commented:

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?

Cheers,

Fracture
0
 
Carl TawnSystems and Integration DeveloperCommented:
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.
0
 
FractureAuthor Commented:
Hey Carl,

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

Kind Regards,

Fracture
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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