Solved

close MSXML2.ServerXMLHTTP.3.0  object asp

Posted on 2009-07-15
1
2,755 Views
Last Modified: 2012-05-07
Hi , I am using ajax in classic asp. I would like to close the object of type MSXML2.ServerXMLHTTP.3.0 .


Set objXmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
objXmlHttp.open "GET", strUrl, false, "user", "123"
objXmlHttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
objXmlHttp.send()

if objXmlHttp.status = 200 Then
      Set responseXML = CreateObject("Msxml2.DOMDocument.3.0")
       Response.ContentType = "text/xml"
       Response.CharSet = "UTF-8"
         responseXML.async = False
       responseXML.load objXmlHttp.responseStream
       responseXML.save Response
      else
      Response.write objXmlHttp.status
      
end if
0
Comment
Question by:Saroj13
1 Comment
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 24875581
There is no close() method. If the request is taking too long and you don't want to wait for it to complete, use the abort() method (but this you use only if you are making an asynchronous call. This does NOT apply to you since you are making a synchronous call).

If you are trying to release/free resources, make sure you set the object to nothing once you are done.

Set objXmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
objXmlHttp.open "GET", strUrl, false, "user", "123"
objXmlHttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
objXmlHttp.send()
 
if objXmlHttp.status = 200 Then
      Set responseXML = Server.CreateObject("Msxml2.DOMDocument.3.0")
       Response.ContentType = "text/xml"
       Response.CharSet = "UTF-8"
         responseXML.async = False
       responseXML.load objXmlHttp.responseStream
       responseXML.save Response
else
      Response.write objXmlHttp.status
      
end if
Set objXmlHttp=Nothing

Open in new window

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 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