473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Microsoft.XMLHTTP

I've been searching everywhere online to find an alternative method besides
using Microsoft.XMLHTTP (as it freezes the server up alot!!) but with no luck
at all.

I am using server side ASP, and some said to use Microsoft.ServerXMLHTTP
instead. However I have tried that as well and it still freezes up the whole
thing (i.e. the site just keeps loading forever).

I tried to do a "on error resume next" clause to catch the error but still
doesn't stop the page being freezing up.. :(

I saw someone here said don't use XMLHTTP in ASP as it is not thread safe
(is that why it is freezing up??), and suggest to use
MSXML2.ServerXMLHTTP.3.0.

so do anyone know if MSXML2.ServerXMLHTTP.3.0 will help? i.e. not freezing
up the page? Please help!!!!!!

Vanessa
Jul 12 '07 #1
14 14092
=?Utf-8?B?VmFuZXNzYQ==?= wrote on 12 jul 2007 in
microsoft.public.inetserver.asp.general:
I've been searching everywhere online to find an alternative method
besides using Microsoft.XMLHTTP (as it freezes the server up alot!!)
but with no luck at all.
Does it really freeze the server, so no other users can access it,
and the server has to be restarted, or does it freeze the browser?
I am using server side ASP,
On your own machine via localhost:// or on the web?
and some said to use
Microsoft.ServerXMLHTTP instead. However I have tried that as well
and it still freezes up the whole thing (i.e. the site just keeps
loading forever).
Wouldn't that be because you made some error in your code?

Why not show your code, just an minimized example that does what you say.

I manage quite well with asp-vbscript:

Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
(i.e. the site just keeps loading forever).
Site's do not load, perhaps the server does, or the browser,
but in the case of Microsoft.XMLHTTP,
how do you know the supposed freezeup [of the server?] is caused by that?
I tried to do a "on error resume next" clause to catch the error but
still doesn't stop the page being freezing up.. :(
So it is the page that is freezing up, not the server?
The browser, not the server?

"on error resume next" prohibits an error to be shown by the standard
error page of ASP, and to be later catched by your own code, it does not
catch errors that would not be signalled otherwise.
I saw someone here said don't use XMLHTTP in ASP as it is not thread
safe (is that why it is freezing up??), and suggest to use
MSXML2.ServerXMLHTTP.3.0.
Wrong approch, I think, first find the diagnosis, then the therapy.

Start with "What is freezing up?"
so do anyone know if MSXML2.ServerXMLHTTP.3.0 will help? i.e. not
freezing up the page? Please help!!!!!!
Again, show a simple code that does the harm you say.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 12 '07 #2

"Vanessa" <Va*****@discussions.microsoft.comwrote in message
news:0B**********************************@microsof t.com...
I've been searching everywhere online to find an alternative method
besides
using Microsoft.XMLHTTP (as it freezes the server up alot!!) but with no
luck
at all.

I am using server side ASP, and some said to use Microsoft.ServerXMLHTTP
instead. However I have tried that as well and it still freezes up the
whole
thing (i.e. the site just keeps loading forever).

I tried to do a "on error resume next" clause to catch the error but still
doesn't stop the page being freezing up.. :(

I saw someone here said don't use XMLHTTP in ASP as it is not thread safe
(is that why it is freezing up??), and suggest to use
MSXML2.ServerXMLHTTP.3.0.

so do anyone know if MSXML2.ServerXMLHTTP.3.0 will help? i.e. not freezing
up the page? Please help!!!!!!

Vanessa

Yes you should be using ServerXMLHTTP. You should also be using the version
specific MSXML.ServerXMLHTTP.3.0.

Are you making a request back to your own server? If so it is prone to
deadlock. If you have ASP debugging on then you can't make a request to
another ASP page on your own server from ASP.
--
Anthony Jones - MVP ASP/ASP.NET
Jul 12 '07 #3
"Evertjan." wrote:
=?Utf-8?B?VmFuZXNzYQ==?= wrote on 12 jul 2007 in
microsoft.public.inetserver.asp.general:
I've been searching everywhere online to find an alternative method
besides using Microsoft.XMLHTTP (as it freezes the server up alot!!)
but with no luck at all.

Does it really freeze the server, so no other users can access it,
and the server has to be restarted, or does it freeze the browser?
I am not sure if it is freezing up the server or the browser, but when the
deadlock happened, I tried to access the site from different stations and all
browers are showing 'loading......' and it never responds. But the weird
thing is the other sections of the site which doesn't call any XMLHTTP
methods are still running and responding back. So is that freeze on the
browser or server?

At this case, I have to restart the IIS Admin Service and the site is back
to normal.

One thing I forgot to mention is -- it doesn't freeze all the times, most of
the time it is running fine and able to read/write data via XMLHTTP.
>
I am using server side ASP,

On your own machine via localhost:// or on the web?

On my company's website.
>
and some said to use
Microsoft.ServerXMLHTTP instead. However I have tried that as well
and it still freezes up the whole thing (i.e. the site just keeps
loading forever).

Wouldn't that be because you made some error in your code?

Why not show your code, just an minimized example that does what you say.

I manage quite well with asp-vbscript:

Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")

Here is one section of my script:

PostURL = linkhome & "nav/GetCustomer.asp?CustomerID=" &CustomerID
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "POST", PostURL, false,"",""
xml.Send
getcustomXML = xml.responseText
Set xml = Nothing

It seems like it got stuck at "xml.Send" line
>
(i.e. the site just keeps loading forever).

Site's do not load, perhaps the server does, or the browser,
but in the case of Microsoft.XMLHTTP,
how do you know the supposed freezeup [of the server?] is caused by that?
Actually I still can't figure out the exact cause of the freezeup :( so
please help!

I tried to do a "on error resume next" clause to catch the error but
still doesn't stop the page being freezing up.. :(

So it is the page that is freezing up, not the server?
The browser, not the server?

"on error resume next" prohibits an error to be shown by the standard
error page of ASP, and to be later catched by your own code, it does not
catch errors that would not be signalled otherwise.
I saw someone here said don't use XMLHTTP in ASP as it is not thread
safe (is that why it is freezing up??), and suggest to use
MSXML2.ServerXMLHTTP.3.0.

Wrong approch, I think, first find the diagnosis, then the therapy.

Start with "What is freezing up?"
so do anyone know if MSXML2.ServerXMLHTTP.3.0 will help? i.e. not
freezing up the page? Please help!!!!!!

Again, show a simple code that does the harm you say.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 12 '07 #4


"Anthony Jones" wrote:
>
"Vanessa" <Va*****@discussions.microsoft.comwrote in message
news:0B**********************************@microsof t.com...
I've been searching everywhere online to find an alternative method
besides
using Microsoft.XMLHTTP (as it freezes the server up alot!!) but with no
luck
at all.

I am using server side ASP, and some said to use Microsoft.ServerXMLHTTP
instead. However I have tried that as well and it still freezes up the
whole
thing (i.e. the site just keeps loading forever).

I tried to do a "on error resume next" clause to catch the error but still
doesn't stop the page being freezing up.. :(

I saw someone here said don't use XMLHTTP in ASP as it is not thread safe
(is that why it is freezing up??), and suggest to use
MSXML2.ServerXMLHTTP.3.0.

so do anyone know if MSXML2.ServerXMLHTTP.3.0 will help? i.e. not freezing
up the page? Please help!!!!!!

Vanessa


Yes you should be using ServerXMLHTTP. You should also be using the version
specific MSXML.ServerXMLHTTP.3.0.

Are you making a request back to your own server? If so it is prone to
deadlock. If you have ASP debugging on then you can't make a request to
another ASP page on your own server from ASP.
--
Anthony Jones - MVP ASP/ASP.NET

Thanks Anthony for your response.

for example:

on CheckCustomer.asp:

'process some data

PostURL = linkhome & "/nav/GetCustomer.asp?CustomerID=" &CustomerID
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "POST", PostURL, false,"",""
xml.Send
getcustomXML = xml.responseText
Set xml = Nothing

'process more data based on the getcustomXML

Yes, I am making a request back to my own server. Both the calling script
CheckCustomer.asp and the GetCustomer.asp are making read/write request to
our SQL server. So if that's the result that's cause the freezing, how can I
turn OFF the ASP debugging?

Thanks Much!
>
Jul 12 '07 #5
oh Anthony,

sorry I have one more question - what ASP debugging does? If I turn it off
will it affect anything?

"Anthony Jones" wrote:
>
"Vanessa" <Va*****@discussions.microsoft.comwrote in message
news:0B**********************************@microsof t.com...
I've been searching everywhere online to find an alternative method
besides
using Microsoft.XMLHTTP (as it freezes the server up alot!!) but with no
luck
at all.

I am using server side ASP, and some said to use Microsoft.ServerXMLHTTP
instead. However I have tried that as well and it still freezes up the
whole
thing (i.e. the site just keeps loading forever).

I tried to do a "on error resume next" clause to catch the error but still
doesn't stop the page being freezing up.. :(

I saw someone here said don't use XMLHTTP in ASP as it is not thread safe
(is that why it is freezing up??), and suggest to use
MSXML2.ServerXMLHTTP.3.0.

so do anyone know if MSXML2.ServerXMLHTTP.3.0 will help? i.e. not freezing
up the page? Please help!!!!!!

Vanessa


Yes you should be using ServerXMLHTTP. You should also be using the version
specific MSXML.ServerXMLHTTP.3.0.

Are you making a request back to your own server? If so it is prone to
deadlock. If you have ASP debugging on then you can't make a request to
another ASP page on your own server from ASP.
--
Anthony Jones - MVP ASP/ASP.NET
Jul 12 '07 #6
=?Utf-8?B?VmFuZXNzYQ==?= wrote on 12 jul 2007 in
microsoft.public.inetserver.asp.general:

[...]
I am using server side ASP,

On your own machine via localhost:// or on the web?


On my company's website.
>>
and some said to use
Microsoft.ServerXMLHTTP instead. However I have tried that as well
and it still freezes up the whole thing (i.e. the site just keeps
loading forever).

Wouldn't that be because you made some error in your code?

Why not show your code, just an minimized example that does what you
say.

I manage quite well with asp-vbscript:

Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")


Here is one section of my script:

PostURL = linkhome & "nav/GetCustomer.asp?CustomerID=" &CustomerID
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "POST", PostURL, false,"",""
xml.Send
getcustomXML = xml.responseText
Set xml = Nothing

It seems like it got stuck at "xml.Send" line
You seem to need TWO servers, one for the asp file with the
Server.CreateObject() in it [server1], and another [server2] where the
file the PostURL is pointing to, is located.

[If it is one and the same server, why not access the database directly]

Is this a correct assumption?
(i.e. the site just keeps loading forever).

Site's do not load, perhaps the server does, or the browser,
but in the case of Microsoft.XMLHTTP,
how do you know the supposed freezeup [of the server?] is caused by
that?

Actually I still can't figure out the exact cause of the freezeup :(
so please help!
I would start by using the above code in [server1] to fetch a simple page
in [server2] containing only some text, like "Hello world".

If that gets through, using

response.write getcustomXML

you could try to fetch something simple from your database on server1.

That way you either get lucky when all is working, or you know where you
get stuck, methinks.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 12 '07 #7


"Vanessa" <Va*****@discussions.microsoft.comwrote in message
news:D8**********************************@microsof t.com...
oh Anthony,

sorry I have one more question - what ASP debugging does? If I turn it off
will it affect anything?
Yeah you won't be able to debug your ASP with a script debugger.

--
Anthony Jones - MVP ASP/ASP.NET

Jul 13 '07 #8
Anthony Jones wrote on 14 jul 2007 in
microsoft.public.inetserver.asp.general:
I think we need to establish a few things to summarize where we are at
this point.

You are having a lock up occuring when making an XMLHTTP request to
another ASP page on the same server. You've switched to ServerXMLHTTP
which is the correct thing to do but that hasn't fixed it.
The Question remains if it is ever necessary to do a serverside XMLHTTP
request to another ASP page on the same(!!!) server.

I think not. All things that can be done,
can also done by straight code on the requesting page.

Correct me with an example, if I am wrong.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 14 '07 #9

"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn*******************@194.109.133.242...
Anthony Jones wrote on 14 jul 2007 in
microsoft.public.inetserver.asp.general:
I think we need to establish a few things to summarize where we are at
this point.

You are having a lock up occuring when making an XMLHTTP request to
another ASP page on the same server. You've switched to ServerXMLHTTP
which is the correct thing to do but that hasn't fixed it.

The Question remains if it is ever necessary to do a serverside XMLHTTP
request to another ASP page on the same(!!!) server.

I think not. All things that can be done,
can also done by straight code on the requesting page.

Correct me with an example, if I am wrong.
You're not wrong. I've already demonstrated how an ASP to ASP post can be
rearranged into a shared include and the reasons why it should.

The question that remains outstanding as I see it is why is this locking up?
Whilst I still think the self-post may be a candidate I'm no longer
convinced. In a test environment with debugging turned off there is no
reason for this to fail.

Since the final product is to actually be ASP to ASP.NET my original
suggestion isn't appropriate.
--
Anthony Jones - MVP ASP/ASP.NET
Jul 14 '07 #10


"Evertjan." wrote:
Anthony Jones wrote on 14 jul 2007 in
microsoft.public.inetserver.asp.general:
I think we need to establish a few things to summarize where we are at
this point.

You are having a lock up occuring when making an XMLHTTP request to
another ASP page on the same server. You've switched to ServerXMLHTTP
which is the correct thing to do but that hasn't fixed it.

The Question remains if it is ever necessary to do a serverside XMLHTTP
request to another ASP page on the same(!!!) server.

I think not. All things that can be done,
can also done by straight code on the requesting page.

Correct me with an example, if I am wrong.
Yes, you are right. I will do it with the function & include tag approach
as Anthony suggested.

What if in this case: A.asp calls C.aspx then return control back to A.asp
without refresh? Any way to do it without using ServerXMLHTTP? or preventing
ServerXMLHTTP from hanging?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 15 '07 #11
=?Utf-8?B?VmFuZXNzYQ==?= wrote on 15 jul 2007 in
microsoft.public.inetserver.asp.general:
>The Question remains if it is ever necessary to do a serverside
XMLHTTP request to another ASP page on the same(!!!) server.

I think not. All things that can be done,
can also done by straight code on the requesting page.

Correct me with an example, if I am wrong.

Yes, you are right. I will do it with the function & include tag
approach as Anthony suggested.

What if in this case: A.asp calls C.aspx then return control back to
A.asp without refresh? Any way to do it without using ServerXMLHTTP?
or preventing ServerXMLHTTP from hanging?
What do you exactly mean by "calls" in 'A.asp calls C.aspx'?
And what is 'return control back'?

In classic asp scripting "call" is invoking a subroutine only,
methinks.

Could you give a code example?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 15 '07 #12


"Evertjan." wrote:
=?Utf-8?B?VmFuZXNzYQ==?= wrote on 15 jul 2007 in
microsoft.public.inetserver.asp.general:
The Question remains if it is ever necessary to do a serverside
XMLHTTP request to another ASP page on the same(!!!) server.

I think not. All things that can be done,
can also done by straight code on the requesting page.

Correct me with an example, if I am wrong.
Yes, you are right. I will do it with the function & include tag
approach as Anthony suggested.

What if in this case: A.asp calls C.aspx then return control back to
A.asp without refresh? Any way to do it without using ServerXMLHTTP?
or preventing ServerXMLHTTP from hanging?

What do you exactly mean by "calls" in 'A.asp calls C.aspx'?
And what is 'return control back'?

In classic asp scripting "call" is invoking a subroutine only,
methinks.

Could you give a code example?
sorry for the confusing by using 'call'. Here is my code for
A.asp->C.aspx->A.asp now.

At Customer.asp file:

'....
'process list of data
'....
PostURL = homelink & "CustID.aspx?SearchFlag=PO"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.3.0")
on error resume next
xmlhttp.open "POST", PostURL, false
xmlhttp.send ""
status = xmlhttp.status
if err.number <0 or status <200 then
if status = 404 then
Response.Write "ERROR: Page does not exist (404).<BR><BR>"
elseif status >= 401 and status < 402 then
Response.Write "ERROR: Access denied (401).<BR><BR>"
elseif status >= 500 and status <= 600 then
Response.Write "ERROR: 500 Internal Server Error on remote
site.<BR><BR>"
else
Response.write "ERROR: Server is down or does not exist.<BR><BR>"
end if
else
'Response.Write "Server is up and URL is available.<BR><BR>"
getcustomXML = xmlhttp.responseText
end if
set xmlhttp = nothing
'use the value from getcustomXML to continue processing.
'....
'....

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 15 '07 #13
=?Utf-8?B?VmFuZXNzYQ==?= wrote on 15 jul 2007 in
microsoft.public.inetserver.asp.general:
>
sorry for the confusing by using 'call'. Here is my code for
A.asp->C.aspx->A.asp now.

At Customer.asp file:

'....
'process list of data
'....
At first sight I can see nothing seriously wrong with it,
ecxept some superfluous logic
PostURL = homelink & "CustID.aspx?SearchFlag=PO"
add:

getcustomXML = "" ' initializing
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.3.0")
on error resume next
xmlhttp.open "POST", PostURL, false
Why "post"? I would use a "get".
xmlhttp.send ""
status = xmlhttp.status
if err.number <0 or status <200 then
if status = 404 then
Response.Write "ERROR: Page does not exist (404).<BR><BR>"
elseif status >= 401 and status < 402 then
elseif status = 401 then ' unless you expect numeric fractions: 401.7777
Response.Write "ERROR: Access denied (401).<BR><BR>"
elseif status >= 500 and status <= 600 then
Response.Write "ERROR: 500 Internal Server Error on remote
site.<BR><BR>"
else
Response.write "ERROR: Server is down or does not
exist.<BR><BR>"
end if
else
'Response.Write "Server is up and URL is available.<BR><BR>"
getcustomXML = xmlhttp.responseText
end if
set xmlhttp = nothing
>
'use the value from getcustomXML to continue processing.
'....
'....

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 15 '07 #14


"Evertjan." wrote:
=?Utf-8?B?VmFuZXNzYQ==?= wrote on 15 jul 2007 in
microsoft.public.inetserver.asp.general:

sorry for the confusing by using 'call'. Here is my code for
A.asp->C.aspx->A.asp now.

At Customer.asp file:

'....
'process list of data
'....

At first sight I can see nothing seriously wrong with it,
ecxept some superfluous logic
PostURL = homelink & "CustID.aspx?SearchFlag=PO"

add:

getcustomXML = "" ' initializing
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.3.0")
on error resume next
xmlhttp.open "POST", PostURL, false

Why "post"? I would use a "get".
xmlhttp.send ""
status = xmlhttp.status
if err.number <0 or status <200 then
if status = 404 then
Response.Write "ERROR: Page does not exist (404).<BR><BR>"
elseif status >= 401 and status < 402 then

elseif status = 401 then ' unless you expect numeric fractions: 401.7777
Response.Write "ERROR: Access denied (401).<BR><BR>"
elseif status >= 500 and status <= 600 then
Response.Write "ERROR: 500 Internal Server Error on remote
site.<BR><BR>"
else
Response.write "ERROR: Server is down or does not
exist.<BR><BR>"
end if
else
'Response.Write "Server is up and URL is available.<BR><BR>"
getcustomXML = xmlhttp.responseText
end if
set xmlhttp = nothing


'use the value from getcustomXML to continue processing.
'....
'....


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Thanks Evertjan!!
Jul 16 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Irene | last post by:
Hi, I have an asp page that allows a user to search for info in a DB and add info to a DB. The search uses "ADODB.Connection" objects in the page, but the add will use a call to an isapi dll...
12
by: Botan Guner | last post by:
Hi all, Here is the problem, i'm using Microsoft.XMLHTTP for ie and XMLHttpRequest for mozilla, on my local server which is win2000 server i've no problem with that but when i uploaded the file...
1
by: Raúl Martín | last post by:
I´ve a function in asp that run correctly but If I tried to change it forasp.net in asp: xmlHTTP = CreateObject("Microsoft.XMLHTTP") And I thought to use this sentence for asp.net but the...
3
by: Tim::.. | last post by:
Can someone please help me with this annoying little problem... I use to use Microsoft.XMLHTTP in asp to pull html from other websites and inbed it into my website but for some reason I can't...
39
by: tydbowl | last post by:
I have a problem where the below code chunk causes handle leaks on some machines. The leak APPEARS to be handles to the registry key: HKCU\Software\Microsoft\Windows\CurrentVersion\Internet...
1
by: Ike | last post by:
Ive copied an online example for writing out a php file, programmatically, then would like to re-display that data in a browswer window that automatically refreshes as the data file (getdata.php,...
13
by: yawnmoth | last post by:
<http://www.quirksmode.org/book/printable/xmlhttp.txtshows two alternatives to Microsoft.XMLHTTP - Msxml2.XMLHTTP and Msxml3.XMLHTTP. If my understanding is correct, the different numbers refer to...
2
by: Skyblue | last post by:
I use Microsoft.XMLHTTP to access htm or asp pages on a central web site from other satellite sites. In this way, the same content can be displayed on a dozen websites and I only need to update one...
7
by: czechboy | last post by:
Hi, I would like to send DELETE request to google calendar but nothing of this works: xmlhttp.open("POST",del,false); xmlhttp.setRequestHeader("X-HTTP-Method-Override", "DELETE");...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.