On Sunday, July 24, 2011 10:24:02 AM Itamar_t wrote: > Hi, > > when using CXF, I'm doing smth like this: > > SomeService ss = new SomeService(wsdlURL, SERVICE_NAME); > ISomeService port = ss.getBasicHttpBindingISomeService(); > //use the port > > currently the service and port are created for eah remote method invocation. > should I create the service and the port every time? or should I create the > service (or the port) in a broader scope and re use it? and if so, is it > safe to use the same service (or port) from multiple threads?
Some of this is in the FAQ: http://cxf.apache.org/faq.html#FAQ-AreJAXWSclientproxiesthreadsafe%3F Basically, it's up to you. In general, I would suggest a single "port" and use it for everything, but if you hit some of the caveats mentioned in the FAQ, using a pool of them is also quite manageable. Dan > Thanks in advance > > -- > View this message in context: > http://cxf.547215.n5.nabble.com/reusing-service-port-instance-tp4628346p462 > 8346.html Sent from the cxf-user mailing list archive at Nabble.com. -- Daniel Kulp [email protected] http://dankulp.com/blog Talend - http://www.talend.com
