
Debugging the XML Web Service
Visual Studio offers several methods to build and run an XML Web service from the IDE, such as:
-
Start 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 Debugging method. Once the XML Web service is running, you will attach to the system process in which it is running to debug it. 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 Services (C++).
To use a breakpoint and start the XML Web service with debugging
-
On the Debug menu, select New Breakpoint, and then select Break at Function.
From the New Breakpoint dialog box, type TempConvert3::TempConvert3Class::ConvertTemperature next to Function and click OK to place a breakpoint on the ConvertTemperature method declaration.
-
On the Debug menu, click Start Debugging.
This command instructs Visual Studio to run the XML Web service as it would normally. 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. Clicking the Service Description link returns an XML document that contains the formal service description of the XML Web service. For more information, see XML Web Service Description.
-
On the TempConvert3Class Web Service 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 and while halted, you can perform a variety of tasks. For more information, see Debugger and Language Overview 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.
For more information, see Walkthrough: Debugging an XML Web Service.