Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible to tell Axis to reuse a connection?

Yuriy Zilbergleyt
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,
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic