SOAPDebugApp Sample: Debugging XML Web Services in the Client Memory Space
Demonstrates how to debug an XML Web service created with ATL Server in the memory space of the client application.
The SOAPDebugApp sample illustrates how to use the following:
TClient template parameter of the Sproxy-generated client class
The sample shows a simple way of testing/debugging XML Web services in the memory space of the client application, that is, without involving the Web server.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.
Building and Running the Sample
To build and run this sample
Open the solution file, SoapDebugApp.sln, in the Visual Studio development environment.
Build the solution.
This will build SimpleSoapApp.dll, an XML Web service application DLL implementing a simple HelloWorld SOAP method, and demoApp.exe, a small client application using CSoapDebugClient. No Web deployment is needed to run this sample.
Set a breakpoint at the start of the HelloWorld method of the XML Web service DLL (the simpleSoapApp.h file of the SimpleSoapApp project).
Make sure demoApp is selected as the startup project, and then press F5 to start the client application in debug mode. The breakpoint should be hit.
How the Sample Works
The sample provides a class (CSoapDebugClient) to act as the TClient parameter for the Sproxy-generated client class. The application DLL (the SOAP server) uses an IHttpServerContext interface to read the request and to write the response. Instead of sending the request over HTTP, CSoapDebugClient loads the application DLL (the SOAP server) and then emulates the behavior of a real HTTP server by implementing the IHttpServerContext interface.