Build and consume an ASP.NET Web service
.NET Framework Solution for Web Service Tutorial: This article will brief you about what a Web service is, why it solves many of the key problems common to previous distributed programming technologies, how to build a Web service using Visual Studio .NET, and how to build a client ASP .NET Web application to consume it.

by Patrick Barnes, freelance Web application developer, author, and consultant. Intel Corp.

Before the advent of Web services, other technologies and architectures existed that allowed applications to remotely call procedures exposed by other applications, typically using the TCP/IP protocol. You have undoubtedly heard of Microsoft's version of this technology, called Component Object Model (COM), and subsequently Distributed COM (DCOM). Common Object Request Broker Architecture (CORBA) is a competitor of COM, developed by a consortium of vendors under the aegis of the Object Management Group.

Although these technologies were a breakthrough in distributed computing and served such ends well for at least five years, there were many limitations. Concerning DCOM, its two main disadvantages were:

  • Microsoft-only: DCOM works properly only with binaries written with Microsoft languages and running on Microsoft platforms.
  • Not Suitable for the Internet: DCOM was designed to use the TCP/IP protocol over a LAN or WAN. Firewalls present a serious problem, and performance is often poor and unreliable.
Web services solve many of the problems common to DCOM. A Web service is a unit of code that publicly exposes its functionality as a URL-addressable resource. As such, any client application that conforms to open Web standards such as HTTP and the Simple Object Access Protocol (SOAP)—the main message formatting protocol, as opposed to HTTP, which is a message transmission protocol—can call a Web service, initiate a procedure, and even retrieve data in the form of an XML document. Thus, Web services take care of the two problems with DCOM and other distributed programming technologies:
  • Non-proprietary: Open standards are governed by the World Wide Web Consortium (www.W3C.org) and other grassroots organizations. All communication and data formatting protocols are non-proprietary, detaching this form of remote procedure calling from specific languages and platforms.
  • Internet-savvy: Web services were designed specifically for use over the Internet via HTTP.
This article shows you how to build and consume a basic ASP .NET Web service. It focuses on the steps required to build the Web service and client application that consumes it. For more theoretical or in-depth information about Web services, see the list of resources at the end of this article.

Assumptions and requirements
This article assumes no prior knowledge of Web services, Visual Studio .NET, or Visual Basic .NET. The Web Service is built using Visual Studio .NET, although the IDE is not required to build .NET Web services. You could write the code and compile it using the Visual Basic compiler from the command line. However, this article assumes you are using Visual Studio .NET and thus makes no accommodations for other situations. Finally, you will need access to the Northwind database shipped with Microsoft SQL Server and the Microsoft Data Engine (MSDE).

Creating a Web service project in Visual Studio .NET
Follow these steps show to create an ASP .NET Web service project in Visual Studio .NET.

1. Click Start, point to Programs, point to Microsoft Visual Studio .NET, and then click Microsoft Visual Studio .NET.

2. Click New Project.

3. Select Visual Basic Projects in the Project Types pane.

4. Select ASP.NET Web Service in the Templates pane.

5. In the Location box, enter the name of the Web server with the name of the project, http://ServerName (or Localhost)/intel_wsNWProducts. See Figure 1.


Figure 1. Creating the Project in Visual Studio .NET.
Figure 1. Creating the Project in Visual Studio .NET.


If you're interested in this topic, these articles may be helpful:

Building web services with Visual Studio .NET
Understanding how web services work is key to using Visual Studio .NET...
Security for ASP.NET Developers
Increasingly, ASP.NET developers are being asked to wear two hats; one...
ASP.NET 2.0 Demystified, Chapter 4: Variables and Expressions in ASP.NET
by Jim Keogh McGraw-Hill/Osborne Books ASP .NET 2.0 Demystified e...
Beyond Software Architecture: Creating and Sustaining Winning Solutions, Chapter 8 - Integration and Extension
by Luke Hohmann. Publisher: Addison-Wesley and Prentice Hall. As de...
.NET client application "no touch" deployment: harness the full processing power of the desktop
by Christopher Goldfarb, senior software architect, Intel Software Sol...

Related Jobs:

Java / Portal Developer #Q08913 - VA - Fairfax - BAE Systems
* Description: o The Solutions, Integration and Develo...
Tech Yahoo, Software Dev Eng, Sr #RX1000024966 - CA - Sunnyvale - Yahoo! Inc.
Tech Yahoo, Software Dev Eng, Sr Job No. RX1000024966 Location ...
On-Line Training Developer/ Technical Trainer #Q08862 - VA - Mclean - BAE Systems
* Description: o Develops and executes training course...
Application Consultant #2007CS-LHJLM164521IL33 - CA - El Segundo - Computer Sciences Corporation
Principal Duties and Essential Job Functions: The Opportunity The Con...
Web Developer #Q08983 - FL - Tampa - BAE Systems
* Description: o The candidate will update and maintai...
Tech Yahoo, Service Eng #RX1000025296 - CA - Sunnyvale - Yahoo! Inc.
Tech Yahoo, Service Eng Job No. RX1000025296 Location US - Sunn...
Web Portal Developer/Integrator #1973 - VA - Chantilly - Camber Corporation
Description: Develop, deploy, and maintain a DOD Joint Services spon...
Web Architect 0439 #Q08906 - OH - Wright Patterson Afb - BAE Systems
* Description: o Designs and builds web-sites in suppo...
Technical Trainer/Courseware Developer #Q08857 - VA - Mclean - BAE Systems
* Description: o Develops and executes training course...
Principal Systems Administrator #Q08934 - VA - Mclean - BAE Systems
* escription: o Identify appropriate configuration para...