Welcome to WebmasterWorld Guest from 54.147.44.93

Forum Moderators: httpwebwitch

Message Too Old, No Replies

Read XML From ASHX Handler

Newbie Question

     

Krakken232

5:52 pm on Jul 6, 2010 (gmt 0)

5+ Year Member



Hey, I've got what hopefully is a simple question. We're constructing a real-estate site and we want to use data from a foreclosures API. I've never really done any XML before, but I've got the basics down to the point where I can read in XML data from a remote XML file and display it in HTML (which obviously is much more basic than the end goal, but as long as I can actually read in data from the XML file and do ANYTHING with it, I know how to get the rest done...).

My problem now is that both the API's we want to use don't actually return an XML file--one uses as ASHX handler and the other...well I don't know what it uses. Either way, neither of the request URL's end in .xml. Is there something really simple that I am missing?

I just can't get the XMLHTTPRequest to actually return anything. How do I read in the returned XML data from a URL that doesn't actually end in .xml (which I assume means it isn't actually an XML file, per se)?

[edited by: httpwebwitch at 6:10 pm (utc) on Jul 6, 2010]
[edit reason] removed example URL [/edit]

httpwebwitch

6:09 pm on Jul 6, 2010 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member



An ASHX-ended URL simply reveals that they're using .NET to render the output. An XML web service doesn't need to end with *.xml for it to be good & usable XML. And indeed, the web service is giving out XML, so that part is OK.

You mention XMLHTTPRequest... so I take it you're doing this with JavaScript?
There are better tools for the job - JavaScript is notoriously inept at handling XML. Kind of ironic, but true. It can be done for sure, but it's inevitably more of a struggle than using a server-side method in PHP or ASP or something like that.

But that's not what you asked.
Don't worry about the URL ending with *.xml - the web service is fine. The problem, I'm sorry to say, is on your plate.

Good luck :)

httpwebwitch

6:11 pm on Jul 6, 2010 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to WebmasterWorld!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month