Building the ProductService Web Service In this chapter, you will create the ProductService Web service. This Web service will expose two Web methods. | Building the ProductService Web Service In this chapter you will create the ProductService Web service. This Web service will expose two Web methods. The first method will allow the user to calculate the cost of buying a specified quantity of a particular product in the Northwind Traders database and the second method will take the name of a product and return all the details for that product. Creating the ProductService Web Service In the first exercise you will create the ProductService Web service and implement the HowMuchWillItCost Web method. You will then test the Web method to ensure that it works as expected. Create the Web service 1. In the Microsoft Visual Studio 2005 programming environment create a new Web site using the Web Service template. Make sure you specify File System as the Location and Visual C for the Language. Create the Web site in the Microsoft Press Visual CSharp Step by Step Chapter 28 NorthwindServices folder in your My Documents folder. IMPORTANT Ensure you select the Web Service template and not the Web Site template. Visual Studio 2005 generates a Web site containing folders called App_Code and App_Data and a file called . The .asmx file contains the Web service definition. The code for the Web service is defined in the Service class stored in the file in the App_Code folder and displayed in the Code and Text Editor window. 2. In the Solution Explorer click the NorthwindServices project. In the Properties window set the Use dynamic ports property to False and set the Port number property to 4500. By default the Development Web server provided with Visual Studio 2005 picks a port at random to reduce the chances of clashing with any other ports used by other network services running on your computer. This feature is useful if you are building and testing Web sites in a development prior to copying them to a production server such as IIS. However when building a Web service it is .