Wrox Programmer Forums
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics 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 January 11th, 2010, 05:57 PM
Join Date: Jul 2005
Posts: 317
Thanks: 0
Thanked 0 Times in 0 Posts
Question ASP.NET XML Feed Error

I have an ASP.NET page that parses an external XML feed (please see example 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.


Dim intSWACounter As Integer = 0
        Dim swa_xmld As New XmlDocument() 'Create the XML Document
        Dim swa_nodelist As XmlNodeList
        Dim swa_node As XmlNode
        Dim objShowWeatherAlert As Object = False
        'Check for active severe weather alerts
            'Load the Xml file
            swa_xmld.Load("http://www.weather.gov/alerts-beta/wwaatmget.php?x=COC035") 'LIVE: Example feed
            'What to do when it encounters an error
            swa_xmld.Load(MapPath("/mysite/docs/xml/weatheralert_down.xml")) 'DOWN
            'Include code to run, no matter whether the code throws an exception or whether it runs successfully
            'Get the list of name nodes
            Dim xnm As New XmlNamespaceManager(swa_xmld.NameTable)
            xnm.AddNamespace("atom", "http://www.w3.org/2005/Atom")
            swa_nodelist = swa_xmld.SelectNodes("/rss/channel/item[title != 'There are no active watches, warnings or advisories in Colorado (Douglas/COC035)']", xnm) 'LIVE
        End Try

Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementing RSS FEED in Asp.Net suresh_net RSS and Atom 0 August 8th, 2008 10:15 AM
ASP.NET XML Feed Error kwilliams ASP.NET 2.0 Professional 0 February 19th, 2008 05:41 PM
parse error xml load document asp.net academics2006 ASP.NET 1.0 and 1.1 Basics 0 March 13th, 2006 03:21 PM
xml feed with javascript jon8884 Javascript 5 June 22nd, 2005 01:15 PM
XML news feed sankar XML 1 December 17th, 2003 05:28 AM

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