Throughout this book, you have used the Add Web Reference dialog box to add a web service to a program by specifying the location of the service’s WSDL statements. As your programs evolve, there may be times when the program no longer needs a web service you previously added to the program. To remove the web service from your program, you use the Visual Studio .NET Solution Explorer as follows:
Within Visual Studio .NET, display the Solution Explorer, if it is not currently open, by selecting the View menu Solution Explorer option.
Within the Solution Explorer, right-click the entry for the web service you no longer desire (for the web services that you create yourself, you will right-click the service’s localhost entry). Visual Studio .NET will display a popup menu.
Within the popup menu, select Delete.
In a similar way, there will be many times when you change a web service, possibly by adding a new method or by changing the number of parameters a method supports. In such cases, you must update the web reference the program is using to access the web service. That’s because the web reference contains the SOAP entries that define the service’s parameters. If you do not update the web reference, your program will not be aware of the changes you have made. To update the web service, simply use the Add Web Reference dialog box to replace the existing web service.