Skip to main content
Visual C++ Samples 
SecureSOAP Sample: Implements a Secure SOAP Communication (HTTPS) 

Download sample

Demonstrates how to implement a secure SOAP communication.

The SecureSOAP sample shows how to implement a secure SOAP communication using the following:

  • A custom SSL-enabled socket class as a template parameter for CSoapSocketClientT, based on the security support provided by Windows 2000

  • The MSXML HTTP client (CSoapMSXMLInetClient)

  • The WinInet-based HTTP client (CSoapWininetClient)

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.


  • IIS

  • SSL Certificate

  • Windows 2000 or later

Building and Running the Sample

To build the sample

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

  2. At line 57 in SecureValidationClient.cpp, replace <your_machine_name> with the name of your Web server and remove the #pragma message directive at the line above.

  3. Build the solution. This will build SecureValidation.dll, which is a combined DLL implementing the ISAPI interface, a request handler, and a SOAP handler (XML Web service).

  4. Deploy the solution manually:

    1. Create a virtual folder within IIS.

    2. Map a directory to this virtual folder.

    3. Copy SecureValidation.dll and SecureValidation.srf to that directory.

    4. Configure the "dll" and "srf" extensions to be associated with the SecureValidation.dll ISAPI extension DLL.

To set up SSL on your Web server

  1. If you have IIS 5, see http://localhost/iisHelp/iis/misc/default.asp and navigate in the Contents window to Administration->Server Administration->Security->Certificates->Setting Up SSL on Your Server.

  2. See certReadme.txt in the SecureSOAP sample folder. This file contains a step-by-step tutorial on how to generate and install digital certificates.

To run the sample

  1. Run SecureValidationClient.exe.

  2. To check the Web page, use the following URL:


    The Web page will display output showing whether communication succeeded or failed.


See Also