I have an ASP.NET page that parses an external XML feed (please see code below). It works...but when the feed goes down, it subsequently brings my site down. So I've created a default XML document that's located on my internal server a backup method when/if the external feed goes down. But I have no idea how to do this. If someone could let me know how to accomplish this, or point me in the right direction, that would be great. Thanks in advance.
ASP.NET XML FEED CODE
Code:
'Check for active amber alert
Dim strAlertTitle As String, strAlertDescription As String
Dim intAlertCounter As Integer = 0
Dim alert_xmld As XmlDocument
Dim alert_nodelist As XmlNodeList
Dim alert_node As XmlNode
'Create the XML Document
alert_xmld = New XmlDocument()
'Load the Xml file
alert_xmld.Load("http://codeamber.org/a1xl04act/amberalert.xml") 'LIVE
'alert_xmld.Load("http://www.mysite.com/docs/xml/alert.xml") 'DEFAULT XML DOC TO USE AT DOWNTIME
'Get the list of name nodes
alert_nodelist = alert_xmld.SelectNodes("/AmberAlerts/AmberAlert[Alertstatus/@status = 'open' and contains(Alertinfo/@states, 'CO')]")
'Loop active amber alerts
For Each alert_node In alert_nodelist
intAACounter = intAACounter + 1
If intAACounter >= 1 Then
strAlertTitle = "Amber Alert"
strAlertDescription = "There is currently an amber alert in Colorado."
Else If intAACounter = 0 Then
strAlertTitle = "Amber Alert"
strAlertDescription = "There are currently no amber alerts in Colorado."
End If
Next 'end loop
Response.Write(strAlertTitle & ": " & strAlertDescription & "<br /><br />")
KWilliams