Dear experienced cxf users,
I’m working with cxf for the first time and have issues to determine how to
ensure thread safety. I have read the FAQ but am not sure what’s exactly the
“client”.
*** The facts:
-----------------------
I want to call a web service (my code is the client) from a server system
-> Therefore I have multiple requests and threads.
I want to set the timeout for the call
-> Therefore if have to use ((BindingProvider)
authPortType1).getRequestContext().put(JAXWSProperties.CONNECT_TIMEOUT, 1 * 60
* 1000);
*** The questions:
-----------------------
1.) How can I achieve this thread safety?
a) I could set
((BindingProvider)myPortType).getRequestContext().put("thread.local.request.context",
"true"); but that would make it risky if someone is using the HttpConduit
Object later.
b) I could create a new client each time but that would be expensive, depending
on question
2.)What is the first object that is not thread safe? The ‘service’-class? The
object implementing the PortType interface? Do I have to parse the WSDL each
time I want a new client object?
3.) What is ClientProxy.getClient() for? Does it create a new object? A new
client? Is this the solution to thread safety? ;-)
Any help would be nice. Thanks in advance.
Best regards
Tom
___________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192