In addition the the previous comments there are two things I don't like:1. Exposing a java class as a webservice. Is this good programming practise? Where is the interface?
I pretty agree with you, It's generaly a good pratice to devellop by interface. But for a web service, this is not necessary as the client won't use this interface but generate one from WSDL (client is server technologie agnostic).
2. Importing javax.jws.WebService in an service implementation\interface makes your ties your service definition already to the way it will be exported. These things should not be mixed. What if I also want to export this service using EJB, REST, Burlab, Hessian. I.M.O. the service implementation and the way it is exported should not be mixed.
I'm agree too, but it's a problem due to annotations not web-service specific (it's the same problem for EJB3).
I.M.O, most of time, annotations introduce a concept flaw. For exemple, in EJB3 your persistant POJO (say a Customer) carry SQL mapping informations. Those informations are exposed to the presentation layer when rendering those POJOs (displaying all the Customers).
Anyway, even if this design is not clean, i must admit that annotations are a very productive and simple way to accomplish many things.
I.M.H.O the cleanest way do deploy a web service is just to mention a class name somewhere (in web.wxm, in spring context, ....). By default :
- no need to specify an interface
- all the public method are exposed "as meb-method"