Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it possible to tell Axis to reuse a connection?  RSS feed

Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a java program, written by someone else, that uses Axis generated stubs to invoke methods on a web service. The problem is that there is a large loop, and a method gets invoked with each iteration, creating a new connection each time. Is there a way to make subsequent iterations reuse the same connection?

Here is the general structure of the loop and the code it executes:

where it all begins:


MyPortBindingStub.receiveEvent(...) (mostly auto-generated):

As you can see, the code tries to keep no more than 20 invocations going on at once. I know that since there's no synchronization it's possible for more than 20 calls to happen concurrently, but that's no big deal. The problem is, how to make sure that all the calls in the for loop reuse the same connection? I'm assuming that even if proxy.invoke() uses the same Port stub for every call, a new connection will still be created each time.

Could someone familiar with Axis offer any advice?

Thank you,
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!