Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual C++
Reference
Libraries Reference
ATL Server
Concepts
 Creating XML Web Service Clients
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
ATL Server Library Reference 
Creating XML Web Service Clients 

To create an XML Web service client using C++:

  1. On the Project menu, click Add Web Reference to display the Add Web Reference dialog box.

  2. Enter the URL for a discovery document or the WSDL description of the XML Web service.

    For example, the description of a typical XML Web service created with ATL Server and deployed locally can be found using a URL of the following form:

    http://localhost/Project/Project.dll?Handler=GenServiceWSDL
  3. Select Add Reference to have SPROXY generate a header file containing a proxy class for the XML Web service. The header will be automatically added to your project so that you can use Class View to view the classes and methods available to you.

  4. Include the SPROXY-generated header in the file or files where you will write the code to access the XML Web service.

  5. Make sure COM is successfully initialized before using the XML Web service proxy class.

  6. Create an instance of the XML Web service proxy class. Either specialize the SPROXY-generated class template using the appropriate XML Web Service Client Archetype, or use the default typedef.

  7. Optionally set proxy settings or use features specific to the proxy class for controlling the connection, authentication, and other settings.

  8. Write code to call the methods on the XML Web service.

    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.

Example

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

SOAP Client Code

Provides code for a simple XML Web Service client. Server code can be found in the SOAP Server Code topic.

Extension Management XML Web Service Client

Provides code for an XML Web service client that access the thread pool management service using NTLM authentication.

Creating an XML Web Service Using ATL Server

Walks you through the creation of an XML Web service client using C++. For comparison, the same XML Web service client is also created using Visual Basic, C#, and Managed Extensions for C++. See Creating and Accessing XML Web Services Walkthroughs for details.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content      
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker