Friday, July 3, 2009

Web services are easy

I started reading about web services today, using the on-line Safari book collection. I'm reading O'Reilly's RESTful Web Services, which seems a good introduction to them.

Web services are easier than I thought. Here's a quick run-down:

Web services run on top of HTTP just like the web. With a "normal" web request, a human uses a browser to request a document. The web server returns the document in HTML format. (There are some variations on this, such as dynamically generated documents.) The browser renders the HTML for the human.

With a web service, a program makes the request, not a human. The request goes to the web server, which returns data in XML format, not HTML. Like a normal request, the result may be static or dynamically generated. The program then picks apart the XML and does whatever it needs with the data. There are some differences between REST and SOAP, but the idea is the same.

I suspect that the big challenge is not the technicals of requests and responses, but organizing the front-end and back-end programs. Web services define an interface, and they are always important to get right.

No comments:

Post a Comment