wood burning stoves 2.0*
The moose likes Web Services and the fly likes Connection pooling of SOAPConnection objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Connection pooling of SOAPConnection objects" Watch "Connection pooling of SOAPConnection objects" New topic
Author

Connection pooling of SOAPConnection objects

kulkarniSachin Kulkarni
Greenhorn

Joined: Sep 06, 2005
Posts: 1
We have a requirement to pass SOAP Message to the Web service server. Currently we are creating the SOAP messages using SAAJ (SOAP with attachments API for java) APIs provided by SUN. The external system from where we are consuming the webservices has 2 Web servers behind a load balancer to serve the SOAP request. We are using SOAPConnection API of the javax.xml.soap package for connecting to the Web Service. Using this we are able to create SOAPMessage and send to Web Service for execution.

However, the requirement is to create a Connection Pool with the SOAP connections to the Web Service. To do this, we need some clarification

1) Is it worth creating SOAP connection (object) pool with SOAPConnection object? Because, as per the API, the actual connection to the webservice takes only when call() method of the SOAPConnection is invoked.In the same method call the connection and message passing to Web Service service is happening.

2) Is there any techniques in java to pass SOAP Message over HTTP which facilitates connection pooling aswell?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41065
    
  43
From your post it seems that you use HTTP as your transport mechanism. You can't pool HTTP connections. They're opened, a request is sent, a response is received, then they're closed. The only way to reuse them is via a mechanism called HTTP pipelining, which lets you send several requests in a row over the same connection. But that has nothing to do with SOAP, it's pure HTTP, and not generally applicable to SOAP.
Having said that, it might be worthwhile to pool SOAPConnection objects, but I can't imagine that discarding and recreating them introduces a significant overhead over pooling them, because the major time-consuming operation they do is opening the network connection, which -as outlined above- would still have to be done every time.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection pooling of SOAPConnection objects
 
Similar Threads
Consume .Net webservice
SOAP envelop modifcation
long post IBM.158
Setting a Connection to 'keep-alive'
SoapConnection timeout