5.3 ServiceFactory and ServiceCall

The following diagram shows the type hierarchy for two distinct implementations of service calls to invoke the getRootElements WSAPI service. IAGetRootElementsSvc is an interactive implementation, prompting the user to enter data from which it generates the appropriate arguments. ScrGetRootElements is the scripted implementation of the same service. It uses a reference to a previously executed GetRootElements service call to provide arguments to the new service call invocation. The abstract classes between these two implementation classes and the ServiceCall interface provide a common framework for ServiceCall implementations. The AbstractServiceCall class is the common base for all service call implementations. It provides access to the client context, and implements common functionality, such as invoking post-processors.

Figure 5-3 ServiceFactory and ServiceCall

The GetRootElementsSvc class is specific in the getRootElements WSAPI service. There are comparable classes for each WSAPI service (such as LoginSvc or CreateElementSvc). All of these service-specific classes follow the same model:

The two ServiceFactory implementations shipped with MosWsClient are shown at the bottom of the diagram:

New ServiceCall and ServiceFactory implementations are needed to embed the client in another application. ServiceCall implementations should extend the appropriate service-specific class in order to be compatible with other features such as record/playback.