
Debugging the XML Web Service
Visual Studio offers several methods to build and run an XML Web service from the IDE, such as:
-
Start (with Debugging)
-
Start Without Debugging
-
View in Browser
As a Visual Studio project, this XML Web service has separate configurations for Release and Debug versions. Because you created this project using the ASP.NET Web Service project template, Visual Studio automatically created these configurations and set the appropriate default options and other settings. For more information, see How to: Set Debug and Release Configurations.
In this walkthrough, you will place a breakpoint in the XML Web service and use the Start (with Debugging) method. For more information, see How to: Debug XML Web Services in Managed Code.
Prior to debugging, verify your debug settings. For more information, see Debugging Preparation: XML Web Service Projects.
To use a breakpoint and start the XML Web service with debugging
-
On the Debug menu, choose New Breakpoint, then Break At Function.
On the Function tab, type ConvertTemperature in the Function box and click OK to add a breakpoint on the ConvertTemperature method declaration.
-
On the Debug menu, click Start, then click Ok in the Debugging Not Enabled window to start debugging.
This command instructs Visual Studio to run the XML Web service in the debugger. Visual Studio builds the project and deploys it to the designated development server. Upon completion, the default browser displays the .asmx file from the deployment server.
When you open an .asmx file in a browser, the XML Web service returns a Service helper page that provides information about the XML Web service. The Service Description link takes you to an XML document that contains the formal service description of the XML Web service. For more information, see XML Web Service Description.
-
On the Service helper page, click the ConvertTemperature link.
-
In the dFahrenheit box, type the number 212, and then click the Invoke button.
When processing reaches the ConvertTemperature function, processing stops. The Visual Studio debugger highlights the line containing the breakpoint; while it is halted, you can perform a variety of tasks. For more information, see Debugger Roadmap and Viewing Data in the Debugger.
-
On the Debug menu, click Continue to continue processing.
-
The XML Web service responds by returning the converted value in an XML document resembling the following:
<?xml version="1.0" encoding="utf-8" ?>
<double xmlns="http://Walkthrough/XmlWebServices/">100</double>
To stop running the XML Web service and return to the Code Editor, on the Debug menu, click Stop Debugging.
-
On the Debug menu, click Delete All Breakpoints.