Chapter 16. Consuming Web Services


The previous chapter gave an overview of web services and described how to create a web service. This chapter explains how to create a web service client application, also called a web service consumer . The consuming application can be a web page, another web service, or a desktop application.

Once a web service is created and made available to consumers on the Internet, it is up to the developer creating the client application to find the web service, discover what methods are available, create the client proxy, and incorporate the proxy into the client. The client can then make method calls against the remote web service as though it were making local calls. In fact, the client application is making local method calls against the proxyit just behaves as if it is making calls directly to the web service over the Internet.

Depending on the requirements of the consuming application, you can let VS2005 do all the work of creating and referencing the proxy, you can do it all manually, or somewhere in between. This chapter will demonstrate the range of possibilities.

Once the proxy is created, compiled, and referenced, the consuming application can make method calls against the remote web service. As long as the signatures and return types of the exposed web service methods do not change, the proxy will continue to work.

The signature of a web method consists of the name of the method and its parameter list.


The web service can have additional web methods added without breaking the proxy, though the new web methods will be invisible to the consuming application until the proxy source code is regenerated and recompiled. Likewise, existing web methods can have their underlying code modified, but as long as their signature does not change, neither the proxy nor the client must be recompiled.



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