Weather Feed Reader

Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2006
Posts: 1
Reputation: narko is an unknown quantity at this point 
Solved Threads: 0
narko narko is offline Offline
Newbie Poster

Weather Feed Reader

 
0
  #1
Nov 2nd, 2006
These days I’ve been working on creating feed reader which retrieves data from weather.com site. They provide detailed SDK and information you’ll need to read information from their site.

I had to use ASP as script language to read XOAP service data. What is interesting a lot of sites provide good information how to read XML from ASP. And all they say the following code should work:

  1. Set objXML = Server.CreateObject("Microsoft.XMLDOM")
  2. objXML.async = False
  3. objXML.setProperty "ServerHTTPRequest", true
  4. objXML.Load (xmlURL)
  5. If objXML.parseError.errorCode <> 0 Then
  6. Response.Write objXML.parseError.reason
  7. End If

where xmlURL is path to actual XML resource (in case of weather.com it’s xoap.weather.com/weather/… ). But it did not. When I put there local path to XML file on my local drive - it worked perfectly but when I used remote URL - it said kinda “Empty XML resource”. I spent some time investigating this issue and it turned out that I had to use extra parameter in order to get access to remote URL (as far as I understood from the explanation this problem appears due to older XMLDOM versions and probably it won’t ever happen on newer Windows installation). So final working code looks like this:

  1. Set objXML = Server.CreateObject("Microsoft.XMLDOM")
  2. objXML.async = False
  3. objXML.setProperty "ServerHTTPRequest", true
  4. objXML.Load (xmlURL)
  5. If objXML.parseError.errorCode <> 0 Then
  6. Response.Write objXML.parseError.reason
  7. End If

I hope that was helpfull
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the XML, XSLT and XPATH Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC