AJAX XML feeds via Web Service

S

shadow.demon

So ajax is the new black, i've had a couple ideas about how to
implement it. I've alook at ajax.net and few other implementations but
to me they're a bit complex. Maybe it's the way to go to have better
coding.

In the standard case of a dropdownlist, or listbox, that needs to be
filled as the user types (aka google suggest), i thought it might be
best handle the following way.

javascript engine <-> xml request <-> asp.net web service (returns xml)
<-> database

Your javascript engine gets an xml feed from the web service (makes
your javascript engine non-asp.net sepific), and your web service acts
as a layer between your data and the UI. The javascript engine fills
the dropdownlist with the returned xml feed.

Is this the wrong way to picture a AJAX asp.net world? Is it better to
implement an ajax.net style solution?
thanks for the ideas
 
B

Bruce Barker

this is correct. the problem is doing the httprequest and parsing the xml
from javascript. this is not built into the language but supplied by the
browser (maybe).

there are two ways to do the request

1) use a iframe with a form and do a submit, or set the src with the
parametes passed on the url
2) use the XMLHTTP component (if it exists). this component started with IE,
but has been added to firefox and other browsers. actually with firefox and
safari, it support webservice calls directly. in IE security settings may
prevent it from running.

then the javascript need to parse the response. there are several options

1) if iframe, render hidden fields with values
2) use XMLHTTP to parse xml response
3) use eval to excute a javascript statement that set the values
4) write javascript code to parse the xml.

it is also possible to use SOAP. for IE use the web behavior, and for others
use the builtin SOAP support.


-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top