Instead of ‘hanging’ your java client for two to three hours invoking a service, how about it kicking off an asynchronous invocation of the service and returning immediately with a unique ticket ID. You can use this Server Java API method to do this:
import com.wm.app.b2b.server.*
ServiceThread newThread = Service.doThreadInvoke(interface, service, pipeline)
Once the service completes, it persists the result somewhere (perhaps the IS repo or a DB table) indexed to the ticket ID. Your Java service polls a result-retrieval service with the returned ticket ID every few minutes until it gets a result, and give up after a set number of iterations.
#webMethods#Integration-Server-and-ESB#Flow-and-Java-services