This documentation is archived and is not being maintained.

Creating XML Web Services

Visual Studio .NET 2003

To create an XML Web service project

  • Create an ATL Server project as described in Creating an ATL Server Project.

    If you create the project using the ATL Server Web Service icon, an XML Web service will be added to the Web application DLL by default.

    If you create the project using the ATL Server Project icon, you can add an XML Web service to the Web application DLL by selecting Create as Web Service on the Application Options page of the wizard.

To add an XML Web service to an existing project

To implement an XML Web service

  1. Add methods to the interface in the wizard-generated header file. Use only the marshaling attributes and data types described in Supported Types in XML Web Services Created with ATL Server.
  2. Ensure that structures used in the interface methods are exported by applying the export attribute to them.
  3. Implement the interface methods in the soap_handler class in the wizard-generated header file. Add the soap_method attribute to each method to tell the compiler that it should be exposed through SOAP.
  4. If appropriate, apply the soap_header attribute to one or more SOAP methods in the class.

    Always use the memory manager returned by CSoapRootHandler::GetMemMgr to allocate memory for [out] or [in, out] parameters and SOAP headers, except BSTRs which must always be allocated with SysAllocString, CComBSTR, or a related function or class.

  5. Build the project to create the XML Web service DLL.

Example

You can find example code and further information in the following topics:

SOAP Server Code
Provides code for a simple XML Web service. Client code can be found in the SOAP Client Code topic.
Creating an XML Web Service Using ATL Server
Walks you through the creation of an XML Web service using ATL Server. For comparison, the same XML Web service is also created using Visual Basic, C#, and Managed Extensions for C++. For details, see Creating and Accessing XML Web Services Walkthroughs.
ATL Server SOAP Samples
Includes a selection of complete XML Web service samples in the SOAP category.

See Also

WeatherService Sample

XML Web Services Created with ATL Server | Providing XML Web Services | Consuming XML Web Services

Show: