[thelist] Web services - what's the difference?

Lauri Vain lauri_lists at tharapita.com
Sat Dec 14 13:44:01 CST 2002


Peter,

> Right, so is it kind of making your whole back-office system
> out of large objects that gather, compress and make available
> large amounts of data?

Sort of. Think Google API or Amazon API - they're "Web services". You
want to get get access to their database (or to me more exact - you want
something from their database), so you use their 'web service' and "ask"
it from them.

> Right, but how does this work? If I, being on a different host and
> using a different server side language, want to use your zipcode API,
> how do I do it? By HTTP? Do I always receive XML from the API? Can I
> also use JavaScript to pull these XML data files from your API's?

Generally you send out an XML document, which basically asks for some
information. The answer will be a XML document with your data in it (the
data that the function on the remote server gave as the answer to your
'question'). Now, you can take the XML document that came as the answer,
parse it and use the data (or assign it a .XSL document and give both
files to a browser for rendering, like
http://www.sarv.ee/ftp/henn/XML/Demod/pets5xsl.xml... this is uncommon,
though -- usually you want to bind the data you receive together with
some other data to form a more meaningful response and combine
information from several sources).

Another great example would be bus timetables or TV schedules. Asking
for schedules from 100 TV channels, inserting them into your database
and generating a query afterwards for the next user that wants to know
how many times s/he can watch "The Bold and The Beautiful" on one single
day.

There are 'directory' servers on the web (Web service directories),
where you can look up, on which server are the functions that you need
and then choose among those. Check out xmethods.com.

Simple, eh? :)

It can be as simple as that and it can also be VERY complicated
(depending on services you use what you application does). I recommend
signing up for some courses or buying a good book.

Book suggestions anybody?

Now, I will go back and take a second scoop to answer some remaining
questions:
> If I, being on a different host and using a different server
> side language, want to use your zipcode API, how do I do it? By HTTP?
> Do I always receive XML from the API?

Yes, you generally receive it in XML (which runs on HTTP or SMTP or
FTP..., which runs on TCP and IP and so on :)).

XML is *very* good for exchaning... err... you know... well, "stuff".

An important factor is that the server-side language you or "they" use
on their server is irrelevant.

> Can I also use JavaScript to pull these XML data files from
> your API's?

Not too familiar with JavaScript outside of features that help to
enhance user interfaces, but I it probably is not possible. You would
have to form a request and send it to a remote server and then use that
data in an meaningful way -- I don't think you can do that with
JavaScript. Besides, that's not generally the point of a Web Service.
Web services are usually made for machines to interact and give
information to the user.

For more information:
http://www.ariadne.ac.uk/issue29/gardner/
http://www.w3.org/2001/sw/ (another fun concept - Semantic Web)
http://www.perfectxml.com/WebSvc1.asp (good basic introduction)
http://java.sun.com/webservices/docs/1.0/tutorial/doc/IntroWS.html
http://www.webreference.com/js/column96/ (looks like this site kills my
theory about using JavaScript for accessing Web services... dang! :))
http://www-106.ibm.com/developerworks/webservices/library/ws-arc1/
http://www.research.ibm.com/journal/sj/412/gottschalk.html
http://www.oreillynet.com/lpt/a//webservices/2002/02/12/webservicefaqs.h
tml (a *very* good introduction - examples and all)

> >Clear as mud?
>
> Getting clearer, getting clearer.

How about now? :)

Cheers,
Lauri




More information about the thelist mailing list