aspose file tools*
The moose likes Web Services and the fly likes Invoking webservice with axis HttpConnection pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Invoking webservice with axis HttpConnection pool" Watch "Invoking webservice with axis HttpConnection pool" New topic
Author

Invoking webservice with axis HttpConnection pool

vu lee
Ranch Hand

Joined: Apr 19, 2005
Posts: 189
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
Marshal

Joined: Mar 22, 2005
Posts: 42906
    
  69
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

Joined: Apr 19, 2005
Posts: 189
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
Marshal

Joined: Mar 22, 2005
Posts: 42906
    
  69
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

Joined: Apr 19, 2005
Posts: 189
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

Joined: Apr 19, 2005
Posts: 189
found it. Just overwrite the max connection property in AxisDefault.properties file.
Siddharth Pareek
Greenhorn

Joined: Aug 26, 2010
Posts: 3
Hi vu lee,

Could you please specify how did you made code changes and did that worked ?



Thanks & Regards,
Siddharth Pareek
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Invoking webservice with axis HttpConnection pool