PRACTICUM XML WEB SERVICES
2
Practice 1 – Building a web service Objective In this practice, you will build a web service that exposes information on rentable cars that is stored in SQL Server. The service will be tested using a browser. Practice source You can find all the files related to this practice in the directory \practicum\Web services\ Steps 1. Open Visual Studio.NET and start an ASP.NET web service project. 2. Add the VehicleDC project to the solution and add a reference to the project. This project contains functionality to retrieve data from and update data to the CarRental database 3. Add a web method to the web service that returns a dataset containing all available cars. Use the appropriate dataclass method to retrieve the data from SQL Server 4. Run the application and try to invoke the method from the browser
PRACTICUM WEB SERVICES
© CLASS-A
3
Practice 2 – Consuming a web service Objective In this practice, you will build a client that uses the web service built in practice 1. Practice source You can find all the files related to this practice in the directory \practicum\Web Services. Steps 1. Open Visual Studio.NET and start an ASP.NET web application project or a Windows application project. 2. Add a Web reference to the web service you created in practice 1. (You can also create a C# proxy by using the WSDL.EXE command line tool. Use. Add the .cs file to the ASP.NET web project you just have created.) 3. Add a datagrid and a button to the form 4. Behind the button create an instance of the web service proxy and call the web method. Bind the result to the data grid. 5. Build and test the client
PRACTICUM WEB SERVICES
© CLASS-A