Chapter 15. Creating Web Services


The World Wide Web has opened up distributed computing on a large scale. However, normal web pages allow for interaction only between a client browser and the web server hosting the web page.

The goal of web services is to create web-based applications that interact with other applications with no user interface. If you're a web page developer, having such web services available can greatly increase your productivity. Imagine, for instance, you are creating a web site for a stock brokerage firm. Rather than integrating your back-end database with all the databases of the different stock exchanges, your application can communicate with their web services, exchanging data in XML format.

Web services are loosely coupled and are entirely independent of the operating system or programming language used on either the server or the client side. Unlike previous technologies for distributed computing (such as DCOM or CORBA), web services do not require that both ends of the connection be programmed in the same language or even be running on the same operating system. For example, the server code might be written in Visual Basic 2005 on Windows XP while the client is written in C++ running on a Unix machine.

If you own both ends of the wire (you are building both the client and the server), web services may not be the best solution. You will get better performance by using .NET remoting, a tightly coupled, proprietary format that sends binary data rather than XML files over the wire. For an introduction to .NET remoting, see Programming C# , Fourth Edition, by Jesse Liberty (O'Reilly). For comprehensive coverage, see Advanced .NET Remoting , Second Edition, by Ingo Rammer (Apress).

All that is necessary to create a web service is that both the server and the client support the industry standard protocols HTTP, SOAP, and XML. HTTP is the transport protocol used by the Web. Simple Object Access Protocol (SOAP) is a lightweight, object-oriented protocol based on XML, which in turn is a cross-platform standard for formatting and organizing information.

There are two broad aspects to web service development: creating the web service and consuming the web service. This chapter provides a high-level view of what web services are and how they work. It describes, briefly , the standard protocols that make web services possible and it introduces how web services are created and consumed. It then covers in detail what is involved in creating web services. We do this two different ways: letting VS2005 do all the work, and performing many of the steps manually. Through the development of a simple stock ticker, we will demonstrate how to create a web service that can be consumed by any number of different types of clients . We also show you how to create a discovery file and how to deploy the web service.

The next chapter looks at web services from the consumer's point of view. We will use the two different techniques of letting VS2005 do most of the work and performing all the steps manually. The first approach is shown with an extremely simple web service, and the latter builds on the stock ticker web service created in this chapter to create a client web application that consumes, or uses, the stock ticker web service.



Programming ASP. NET
Programming ASP.NET 3.5
ISBN: 0596529562
EAN: 2147483647
Year: 2003
Pages: 173

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net