Solved

close MSXML2.ServerXMLHTTP.3.0  object asp

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

911 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

19 Experts available now in Live!

Get 1:1 Help Now