Solved

close MSXML2.ServerXMLHTTP.3.0  object asp

Posted on 2009-07-15
1
2,548 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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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 video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

10 Experts available now in Live!

Get 1:1 Help Now