Debugging Web Services


Visual Basic .NET Unleashed
By Paul Kimmel
Table of Contents
Chapter 18.  Using and Implementing Web Services

Debugging Web Services

You can build and run your Web Service in one of three ways:

  • Set the Web Service as the Startup Project in the Solution Explorer and press F5.

  • Choose Debug, Start Without Debugging (or use the Ctrl+F5 shortcut).

  • Build your Web Service and browse to it.

Integrated Debugging

Web Services can be debugged in the Visual Studio .NET IDE. To debug in the IDE, make a Web Service the startup project. This can be accomplished from the Project menu of the Solution Explorer. Press F5 to run the application.

When you run the application in the debugger, the Service Description page is shown. This page will provide a list of Web methods that you can invoke. To debug a specific method, manage breakpoints in the IDE and invoke the methods from the Service Description page.

When the IDE encounters a breakpoint, Visual Studio .NET will focus the Code Designer and you can debug your code as you would any other application. When you are performing integrated debugging, IIS plays the role of host application and the Service Description plays the role of client.

When you have debugged the basic behaviors of your Web Service using the Service Description, you can incorporate the Web Service as part of a whole solution. If the Web Service is referenced by an ASP.NET Web application, you can use the integrated debugger to step between your ASP.NET Web application and your Web Service. To do so, specify an ASP.NET application as the startup project. (The ASP.NET Web application must have a reference to the Web Service.) Press F5 to begin debugging or F8 to begin stepping. The Visual Studio .NET IDE will step into the Web Service or stop on breakpoints in the Web Service.

Start Without Debugging

If you choose Debug, Start Without Debugging, you will be able to invoke methods using the Service Description page, but the IDE will not break into the Code Designer view. This is equivalent to a form of white-box testing where the Service Description plays the role of thin client.

Build and Browse

The final way to test your application is to build the application, open the browser, and browse to the .asmx page representing the Service Descriptiona thin-client applicationthat you can use to invoke Web methods.


Visual BasicR. NET Unleashed
Visual BasicR. NET Unleashed
Year: 2001
Pages: 222 © 2008-2017.
If you may any questions please contact us: