User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Web Development category of DaniWeb, a massive community of 427,177 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,147 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Web Development advertiser: Programming Forums
Nov 2nd, 2006, 4:17 am
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
This blog entry was written by narko. It has received 4,090 views, 0 comments, and 24 linkbacks.
AddThis Social Bookmark Button

Post Comment

Only community members can start a blog or comment on blog entries. You must register or log in to contribute.

DaniWeb Web Development Marketplace

Related Blog Entries
Related Forum Threads
All times are GMT -4. The time now is 9:29 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC