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 proxy—it 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.

Tip

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

The web service can have additional web ...

Get Programming ASP.NET, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.