Create a Northwind Web Services Project

Purpose:

To create a Web services project primarily to demonstrate the flexibility of the business objects.

Starting Point:

You have the Northwind solution open.  You must have completed the testing of the Region business object.

Steps:

  1. Choose ‘New”, ‘Project’ from the File menu.
  2. Select ASP.NET Web Service as the project type.
  3. Set the Location to  ‘http://localhost/Northwind/PublicServices”.  This will create a web site on your local server in the new PublicServices folder which will be in the new Northwind folder.
  4. Make sure the ‘Add to Solution’ choice is selected, and click OK.
  5. Close and discard the default web Service.
  6. Right-click on the project in the Solution Explorer and select Rename from the context menu.  Rename the project to ‘Northwind.PublicServices’.
  7. Right-click again on the project in the Solution Explorer, but this time select Properties from the context menu.  Change the Assembly Name and the Default  Namespace to ‘Northwind.PublicServices’.
  8. Open the Global.asax code window and change the namespace declaration to ‘Northwind.PublicServices’.
  9. Add a Reference to the Northwind.BusinessObjects project.
  10. Compile and save.

Rationale:

It's what we need.

Discussion:

Once you have built the business objects you need for a Web application, building a Web service is just a matter of exposing already built methods to the web.  You will soon see that there is no real work to it. 

Note, however, that Web services have all of the security concerns of Web applications and more.  A Web service is a Web application for software rather than for humans using a browser.  We won't deal with any of that in this course, but it is a vital concern in a production Web service.

Previous Step: Add an Admin Home Page

Next Step: Add the Sales Service