Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Web Service - Is it a dedicated connection?

 
jyoti j singh
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing Java Web Service (JAX-WS), it's stateless like accessing any website; am I correct?
for example, if I create a web service connection object and use it for multiple business operations; which means that web service connection object would be alive for longer period, does such case impact the web service publisher, since connection (object) is alive on consumer side for longer period? I am under impression that alive web service connection object on consumer side should not impact web-service publisher, it is correct? any suggestion/ knowledge would be great help.
 
jyoti j singh
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, can you please suggest how can I validate if connection (object) is still good or not before making any next business operation call?
 
Tim Moores
Bartender
Posts: 3137
50
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general, you should not keep open connections for long, unless both sides are under your control. For WS, the server side is likely to terminate the connection when it's done with it, so I don't think what you propose would even work. And that's before even considering that HTTP connections (which is what I'm assuming we're talking about) are tied to an URL - and successive operations will likely involve different URLs.
 
jyoti j singh
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim for your reply, by web service connection I meant port object (service.getPort). As you mentioned that "the server side is likely to terminate the connection when it's done with it", and concern about "so I don't think what you propose would even work".
If I am keeping port object live for longer period, and keep it using for different business operations of web service publisher, I am trying to save effort (processing time) to create port object multiple times and trying to understand if there is any negative effect of keeping port object live for longer period.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic