Important: | To compile the following sample code (or any Java client that uses guaranteed delivery), you must include the following import statements in your Java program. import com.wm.data.*; import com.wm.app.b2b.client.*; import com.wm.util.*; import com.wm.app.b2b.client.lic.*; |
# | Step | Description | ||
1 | Declare TContext. | Declare TContext as a variable. | ||
2 | Initialize TContext. | Initialize TContext and specify the job store directory and audit-trail log. The Job Manager starts.
| ||
3 | Instantiate TContext. | Create a new TContext object. | ||
4 | Establish connection attributes for the TContext instance. | Execute connect() to specify the webMethods Integration Server on which you want to invoke services using this context. You must connect as a user who is a member of the Administrators group on the Integration Server.
To set other connection attributes, use methods in the class Context such as the protocol to use (HTTP or HTTPS) and the proxy to use. | ||
5 | Start the transaction. | Execute startTx() to obtain a transaction ID (tid) and specify the transaction time-to-live (TTL). | ||
6 | Invoke the service. | Execute invokeTX() to invoke a service. Note that you pass the transaction ID (tid) as the first parameter to this method. | ||
7 | End the transaction. | Execute endTx() to end the transaction. This method clears the record for this transaction from the Job Manager's job store. | ||
8 | Check for errors. | Check for the different types of errors. Always check for Service Exceptions last. | ||
9 | Close the session on webMethods Integration Server. | Execute disconnect to end the use of this instance of TContext. The application should not perform this step until it is done because disconnect unregisters TContext with the Job Manager. | ||
10 | Shutdown. | The Job Manager ends.
|