Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 24th, 2003, 06:54 AM
Registered User
 
Join Date: Aug 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML HTTP

set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")

xmlHttp.open "POST", applicationpath & "http://xyz.com/some.asp", false

xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

xmlHttp.send "Rajjjjjj"

My Problem is that, if the URL which I specify is not available, I mean if the Server to whom I am sending the Request is down, then I get an Error. How can this be handled? To stimulate this process I mean sending a request to a different m/c and then that m/c gives me the response. This works perfectly fine. Now if I stop the IIS of the other server, I get an Error for the Send method. Can we check any how if the URL which I specifies is alive.

Thanks in Advance
Raj


Thanks and regards,

Raj Babar
 
Old September 24th, 2003, 07:43 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

check the status property, which corresponds to the http response code so 200 is OK, 404 is not found etc.
 
Old September 24th, 2003, 08:15 AM
Registered User
 
Join Date: Aug 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by pgtips
 check the status property, which corresponds to the http response code so 200 is OK, 404 is not found etc.
Hi,

I am checking the status property, but this property is to be checked after the .send() method is called. The problem is I am getting the Error on the .send() line. Here's the error what I am getting. This is when the Server is down.

The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

--------------------------------------------------------------------------------

Please try the following:

Click the Refresh button, or try again later.

Open the dscp02046 home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
(0x800C0005)
/PSTN_DEV/ui/LibAsp/pstnGetInputXml.asp, line 147


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)

Page:
GET /PSTN_DEV/ui/LibAsp/pstnGetInputXml.asp

Time:
Wednesday, September 24, 2003, 6:49:08 PM


More information:
Microsoft Support

Please suggest if V can get rid of the Error. Thanks inadvance.

Thanks and regards,

Raj Babar
 
Old September 24th, 2003, 09:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

OIC, u need to use ServerXMLHTTP component, not XMLHTTP. See http://support.microsoft.com/default.aspx?kbid=290761 (take note of part about proxy config if u go thro proxy server).
 
Old September 26th, 2003, 04:39 AM
Registered User
 
Join Date: Aug 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by pgtips
 OIC, u need to use ServerXMLHTTP component, not XMLHTTP. See http://support.microsoft.com/default.aspx?kbid=290761 (take note of part about proxy config if u go thro proxy server).
Hi,
Well Tried this. Didn't work :-( I tried with both ServerXMLHTTP and XMLHTTP. Since I am doing the stimulation in the Network itself, the ? of Proxy doesn't arises. Anyway I found a work around. I was getting Error for the .send method. I just added the foll lines.
on error resume next
    xmlHttp.send strBody
    errNo = err.number
And then checking if the errNo == "0", then proced or give an alert. Now the II problem is if the URL which I give is to http://mach1/a.asp and if the a.asp doesn't exists or for some reason is being shifted. How do I tackle that. With the above work around I can only see if the Server is up or not. If the Server is up and the URL is wrong I still get the errNo as 0. How can I tackle this situation.




Thanks and regards,

Raj Babar





Similar Threads
Thread Thread Starter Forum Replies Last Post
xml http request AaronT Ajax 0 May 29th, 2008 11:52 PM
http addresses in xml file for Access Ribbons bgnetman XML 3 October 23rd, 2007 11:47 AM
Sending XML via http post, using servlet kermitus Servlets 1 March 14th, 2006 07:03 PM
XML HTTP Post acdsky Servlets 2 June 2nd, 2005 10:59 AM
Transferring xml files between servers over http. s_a_ravi General .NET 0 March 29th, 2005 09:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.