300Microsoft Visual Studio 2010: A Beginner’s Guide

Key Skills & Concepts

Create a Web Service

Deploy a Web Service

Write a Client That Consumes the Web Service

Windows Communication Foundation (WCF) is a .NET technology for creating Web services. A Web service is software that provides functionality that can be used by

any other software application, using any programming language, on any hardware and operating system that can communicate over a network.

The functionality of Web services can be either public or private. Examples of public Web services might be a weather service where you provide the location and you get back a forecast data that you can display on your screen or an address verification application that will validate if a postal address exists or suggest alternatives. Examples of private Web services might be the ability for multiple applications in a large corporation to call a customer Web service with a customer ID and receive that customer’s record, or perhaps an ordering system where you can submit a new customer order and the Web service would process the submission in the background for you.

What’s common about all of the examples in the preceding paragraph is that, regardless of public or private, the Web service is useful for more than one application or system. Everyone needs the same service from the Web service, so why should each application re-invent the wheel every time? Just set up one service and everyone can work with that one service.

You must be wondering how such a broad claim can be made that one technology is accessible by any system regardless of platform, language, or software. The Web service is separated from the calling system via open standards and a well-defined interface. There are ubiquitous communications protocols, such as HTTP, and data format standards, such as XML, that Web services can use. So, if both systems that communicate use Hypertext Transfer Protocol (HTTP) and XML in the same way, then the Web service can be useful. For example, if an application were built on a Sun workstation running Solaris, saving data in an Oracle database, and written in Java, it could still communicate with your WCF service, which is on an Intel-based server, running Windows 2008, saving data in SQL Server, and written in VB. It doesn’t matter because the Java system will translate its

Page 323
Image 323
Microsoft 9GD00001 manual Key Skills & Concepts