My application needs to invoke a SOAP service and is a multithreaded application.
I have generated web service client using cxf-codegen-plugin. Now if invoke the SOAP service using the generated client as
new AddWSService().getAddWS().add(x,y);
Does it hurt performance creating a new Client always? Should I need to consider caching the client instance?
Asked
Active
Viewed 777 times
1

spal
- 731
- 3
- 9
- 20
-
Premature optimization is a bad thing. Dependency Injection is a good thing. – flup Feb 14 '13 at 21:50
-
I agree 100%. But if try to @Autowire AddWSService stub it would not work. How do I inject the client stub in my code? – spal Feb 14 '13 at 21:53
-
Is different question, perhaps http://stackoverflow.com/questions/10888501/how-to-use-spring-autowired-in-a-custom-cxf-interceptor is of help? – flup Feb 14 '13 at 21:56
-
Hum. Wrong link. Cannot find the one I mean. – flup Feb 14 '13 at 22:01
-
anyways I think I got it @WebServiceRef (AddWSService.class) private AddWS; – spal Feb 14 '13 at 22:06