Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Connection pooling of SOAPConnection objects

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
Posts: 43028
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Pay attention! Tiny ad!
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic