Creating C++ Web Services

Artix Encompass provides easy-to-use tools and run time services for creating C++ Web service clients.

Development Time

The developer begins by creating a project in the Artix Designer and adds a WSDL service contract to the project by

  • importing an existing WSDL contract; or
  • creating the WSDL contract in the Artix Designer; or
  • generating the WSDL contract from an external metadata source such as CORBA IDL;

Next the developer uses the Artix Designer to generate C++ classes, which are client-side proxies for the Web service, and are used in the client program to invoke the Web service. The C++ client-side proxy presents a simple, business-oriented interface that hides the details of creating the SOAP message (including envelope, header, and body), and calling the transport level APIs for sending the message.

This approach allows the underlying transport to be changed at anytime (for example, replacing HTTP with MQSeries) in a declarative fashion and without changing any client code (see Multi-Transport Web Services).

Of course, Artix Encompass provides APIs so that the developer can manipulate the SOAP message and call the transport level APIs if that level of control is needed. (see Artix Programmers Manual).

Run Time

At run time, Artix Encompass is loaded into the client process and it handles the transmission of SOAP messages over the selected transports (HTTP by default). For instance, the C++ Client can communicate with a remote Web service over HTTP (e.g., Google), with an MQSeries application over MQSeries, or with a CORBA application over IIOP.

If a SOAP fault is returned during a Web service invocation, it is translated into an appropriate C++ exception which the client can handle using the normal C++ exception handling mechanism (see Artix Programmers Manual).

See the following sections for more information on the other Artix Encompass run time services that can be used in conjunction with an Artix C++ Web Service Client.

  • Secure Web Services
  • Role-Based Access Control
  • Scalable Web Services
  • Mission-Critical Web Services

Artix Encompass provides easy-to-use tools and run time services for creating C++ Web service providers.

Development Time

The developer begins by creating a project in the Artix Designer and adding a WSDL service contract to the project by

  • Importing an existing WSDL contract, possibly generated using a third party tool; or
  • creating the WSDL contract in the Artix Designer; or
  • generating the WSDL contract from an external metadata source such as CORBA IDL

Next the developer uses the Artix Designer to generate C++ classes, which are server-side skeletons for the Web service.

The developer then simply adds the necessary business logic to the C++ Server-Side Skeletons to create the necessary Web service provider (see WSDL to C++ Mapping for an explanation of how the WSDL service contract is mapped to the C++ data types). By repeating these steps the developer can create any number of C++ Web Services Providers, which can then be deployed into one process or split into multiple processes.

Artix Encompass provides APIs for directly manipulating the SOAP message, if needed,or writing SOAP message handlers that can be plugged-into the Artix run time to provide specialized processing of some or all SOAP messages.

Run Time

At run time, the Artix Encompass run time receives incoming SOAP messages and dispatches them to the Web Service Provider. Artix Encompass Promotes scalability by allowing multiple service providers to share the same port so that "port starvation" does not occur. Furthermore, the Artix Encompass run time is capable of handling SOAP messages arriving over a variety of transports including HTTP/S, MQSeries and others (see Multi-Transport Web Services).

To achieve better performance, Artix Encompass allows multiple instances of the same Web Service Provider to run in the same process or in different processes, and Artix Encompass supports the following threading policies for automatically managing server instances:

  • Single Instance / Multi Threaded - A single multi-threaded instance is created and shared by multiple threads. In this case, the servant object must expect to be called from multiple threads simultaneously (i.e., it must be thread-safe).
  • Multi Instance - A distinct servant instance is created for each thread and each servant instance only processes incoming requests for its thread.

Advanced Features

A C++ server factory is responsible for managing the lifecycle of C++ servant objects. Although the WSDL-to-C++ compiler provides a convenient default implementation of the server factory class, you can provide a custom server factory implementation to do the following:

  • Override default the WSDL location
  • Register multiple ports per service
  • Register a server factory against multiple services
  • Create multiple servants per port or share one servant between ports

IN DEVELOPER CENTER...

Related Content

Need More Info?

Feel free to reach us by phone or email anytime of the day.

Contact Sales

For pricing and license information please contact a sales representative in your region:
AMER, EMEA or APAC