webMethods Integration Server C/C++ API Documentation

 Introduction

C/C++ API are based on the Java Native Interface(JNI) - these APIs wrap the JNI as a convenience to working with the core Java APIs. However, the JNI may be used directly in place of, or in conjunction with these APIs. Since these APIs provide with wrappers over the core Java APIs, please consult those APIs directly to better understand their capabilities.

 C/C++ Service API

C/C++ Service APIs are used exclusively by C Services. These APIs allow the service to invoke other services using the invokeWmService() or invokeWmServiceThreaded() function. Simply synthesize the required input record and pass along with the folder name and service name. For backward compatibility, the session record is used in invokeWmService(). However, it is no longer needed and therefore not used in invokeWmServiceThreaded(). To retrieve the results from the threaded invoke, you need to call getWmServiceThreadData(). Also note that threaded invoke creates a return context which must be freed with freeWmSvrContext() when no longer needed. However, the standard server context passed in to your service is created (and freed) in the code generation service template and should therefore not be explicitly freed.

These APIs also allow you to handle errors/exceptions in C Services. You may log an error message to Integration Server's default log file with logWmServiceError(). You may also create an error record with throwWmServiceErrorMsg() or throwWmServiceError().

 C/C++ Client API

C/C++ Client APIs are used to implement C clients that invoke IS Services. It uses JNI to wrap the Java-based APIs implemented as Context (for normal invocations) and TContext (for guaranteed delivery or transactional invocations).

Normally, you will first call initWmClient() to initialize the JNI environment. However, if you need to modify the standard JVM arguments, or pass properties to the JVM, you will need to do so before initialization. To set JVM options, construct your own JDK1_1InitArgs (see jni.h) and set the external variable wm_jvm_args. To pass properties, call initJVM1_1Args(char** properties) with a zero-terminated array of strings in "name=value" form; Java classpath is set directly from the CLASSPATH environment variable. When done make sure to call shutdownWmClient().

All API calls are tagged with the type of context that is being used. Note that the TContext shares some calls with the normal client context - in particular setting rpc types, connection attributes, and security credentials. Also note that the transactional calls (Tx) can only be used with TContext as they all require a transaction id(WmTid) whereas the synchronous and asynchronus calls are only used with a normal context. When using the TContext from a client, you will also have to initialize the transaction manager, as well as shut it down when you are done. If you intend to share contexts between threads, make sure to clone your context with cloneWmContext(). For TContext, make sure to call initWMTContext() from same master thread after calling initWMClient().

 Utilities API

Utilities API are used by C/C++ Service and C/C++ Client. These are listed below:

 

webM-IS-CAPI-910-20160415

 

 Copyright © 1998 - 2016 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.