
Debugging the XML Web Service Client
When you run the application, it accesses the XML Web service and displays the Celsius equivalent of the entered Fahrenheit temperature.
Visual Studio offers several methods to build and run an application from within the IDE, such as:
-
Start Debugging
-
Start without Debugging
As a Visual Studio project, this application has separate configurations for Release and Debug versions. Because you created this project using the CLR Console Application 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 application and use the Start Debugging method.
Prior to debugging, verify your debug settings. For more information, see Debugging Preparation: Console Projects.
To use a breakpoint and start the application with debugging
-
In the Code Editor, place the cursor on the line of code that calls the proxy function:
|
double dCelsius = proxy->ConvertTemperature(dFahrenheit); |
-
Press F9 to place a breakpoint on this line of code.
— Or —
Click to the left of that line of code in the indicator margin.
For more information, see How to: Debug Code in the Editor.
-
On the Debug menu, click Start Debugging.
This command instructs Visual Studio to run the application in the debugger. Visual Studio builds the project and launches the application.
-
In the console window, type the number 212 and press Enter.
When processing reaches the breakpoint, 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 Roadmap and Viewing Data in the Debugger.
-
On the Debug menu, click Continue to continue processing.
The application creates a SOAP request message, which it sends to the XML Web service. In return, the application receives a SOAP response message. The application then parses the response and displays a message indicating that 212 degrees Fahrenheit is the equivalent of 100 degrees Celsius.
To stop running the application and return to the Code Editor, on the Debug menu, click Stop Debugging.
-
On the Debug menu, click Delete All Breakpoints.