Main Page

Web Services

Web Services
In the past two years, Web services have become a hot topic. Thanks to Microsoft’s .NET initiative,
developers are now able to create, deploy, and access Web services quickly and easily. The idea is
simple: Servers can provide (
) Web services over the Internet. Any developer can access this
functionality from a program, seamlessly providing the functionality encapsulated by the Web ser-
vice. But Web services aren’t available only to compiled programs; they are also available to Web
pages using JavaScript.
A Quick Web Service Primer
Understanding what Web services are is the key to understanding how to use them. This section
covers some of the basics.
What is a Web service?
Think of a Web service as a function call, only this function exists on a server while being called
from the client. This necessitates that messages be sent back and forth between the client (called
the consumer) and the server. These messages are in a format called SOAP (Simple Object Access
Protocol), which is an XML-based wrapper for Web service messages. The SOAP message is trans-
ferred using a standard HTTP request (although other protocols can be used as well) with a couple
of special request headers:
— Gives a specific SOAP action to take if there are multiple possible actions.
If only one action is possible, this is typically left as an empty string.
— Set to text/xml
20_579088 ch17.qxd 3/28/05 11:42 AM Page 509

JavaScript EditorFree JavaScript Editor     Ajax Editor