WebMethods Client Connectivity using TContext Class

Hi everyone,

I have a client request to build a stand-alone java client to facilitate the transport of business documents.

I am planning to use the client.jar/TContext class. A few questions:

There are three data types supported: IData, Binary, and XML. Is there a preferred data type? XML seems to be the most flexible. IData, however, makes me greedy, because the server will accept and IData object without any need to parse the data. Most of the files that will be sent will be flat in nature.

Also, are there any gotchas anywhere else that may surprise me? Everything looks pretty straight forward, but that is never the case.

Hi Ray,
Of course there are gotchas! The TContext is used for guaranteed delivery (gd) and thus uses a set of files to store transaction information (similar to gd within the server). These files have gotten corrupted on occasion.

Since this is running outside of the server, you need to create a startup and shutdown class (for the Transaction manager) and figure out when to start it and shut it down. For us, our client was weblogic so we did this when weblogic booted and when it was shutdown. Starting and stopping it for each request caused us problems and is not preferred.

It is fairly involved to create an IData structure with the API itself, so if you already have an XML file I would pass that across - or if it’s flat just pass it as a string. You could always invoke webMethods services to create the IData but we wanted to minimize the network calls.

On a related note, we passed IData from webMethods to a client and because IData is not serializable we used XMLCoder to serialize the IData into a string. You don’t need to do this going the other way though.

Will

Excellent advice, I will take it to heart. Thank you!

Ray