Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invoking webservice with axis HttpConnection pool

 
vu lee
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently, I'm using org.apache.axis.client.Call to invoke a web service. I don't believe Call using connection pool internally. Since apache does has MultithreadedHttpConnectionManagerIs there a way to config axis client, so it will create, maintain, and get Httpconnection from connection pool?
[ March 22, 2007: Message edited by: vu lee ]
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not aware that there is a way to do this, but I'm fairly certain that it wouldn't make a big difference. HTTP connections (in contrast to JDBC connection) are not kept open -I don't think HTTP keep-alive applies to this situation-, so the savings you get by using a pool is mainly the object instantiation. That used to be a costly operation, but JVMs have gotten much better at it. At any rate, in most if not all circumstances the time needed for instantiation pales in comparison to the time used for making the actual network connection, so I wouldn't think that this is worthwhile persuing.
 
vu lee
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your quick response Ulf Dittmer.
I'm thinking if it is not worth, then why apache put some effort to create such HttpConnection pool (http://wiki.apache.org/ws/FrontPage/Axis/AxisCommonsHTTP).

In my case, we have internal web services which being called multiple times. By reusing connection, instead of creating and destroying it on every single web service invocation, I could gain performance and efficiency in resource management.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you found your answer.

I could gain performance and efficiency in resource management.


Now that you know how to do it, it should be easy to find out whether that's the case.
 
vu lee
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since apache does has MultithreadedHttpConnectionManager, Is there a way to config axis client, so it will create, maintain, and get Httpconnection from connection pool?


To do it myself, I'll need to change several components. I'm asking for an better way-- changing the configuration --, so I don't need to maintain additional code.
 
vu lee
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
found it. Just overwrite the max connection property in AxisDefault.properties file.
 
Siddharth Pareek
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi vu lee,

Could you please specify how did you made code changes and did that worked ?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic