Export (0) Print
Expand All

SOAPDebugApp Sample: Debugging XML Web Services in the Client Memory Space 

Download sample

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

  • IHttpServerContext interface

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.

Security noteSecurity Note

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

  1. Open the solution file, SoapDebugApp.sln, in the Visual Studio development environment.

  2. Build the solution.

    NoteNote

    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.

  3. Set a breakpoint at the start of the HelloWorld method of the XML Web service DLL (the simpleSoapApp.h file of the SimpleSoapApp project).

  4. 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.

Demonstrates

See Also

Community Additions

ADD
Show:
© 2014 Microsoft