471,599 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,599 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 13818
=?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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Botan Guner | last post: by
3 posts views Thread by Tim::.. | last post: by
39 posts views Thread by tydbowl | last post: by
1 post views Thread by Ike | last post: by
13 posts views Thread by yawnmoth | last post: by
7 posts views Thread by czechboy | last post: by
reply views Thread by leo001 | last post: by

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.