Chapter 19. Web Services

WHAT YOU WILL LEARN IN THIS CHAPTER

  • An overview of Web Services

  • How to create a Web Service with ASP.NET

  • How to use a Web Service from a Windows Forms application

  • How to use a Web Service from an ASP.NET client

  • How to call Web Services asynchronously

  • How to pass data across Web Services

While Web applications are a front end for the user to access the functionality of an application, Web services are the front end for applications to access the functionality of an application. Web services are server-side programs that listen for messages from client applications and return specific information. This information may come from the Web service itself, from other components in the same domain, or from other Web services.

This chapter does not go into the inner workings of Web services, but you will get enough information to start creating and consuming simple ASP.NET Web services with the help of Visual Studio.

WHERE TO USE WEB SERVICES

To get another view of what Web services are, you can distinguish between user-to-application communication and application-to-application communication. Let's start with a user-to-application communication example: getting some weather information from the Web. Several websites such as weather.msn.com and www.weather.com present weather information in an easy-to-digest format for a human reader. Normally, these pages are read directly by a user.

If you wanted to create a rich client application to display the weather (application-to-application ...

Get Beginning Visual C# 2010 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.