Search code examples
javaspringweb-servicesspring-mvcwsdl

Call a spring @service from another project


I've been studying Spring MVC 4 and I understand that Spring have several annotations to develop faster. This question and answer explains very well the relation between @Component, @Service, @Repository and @Controller. My questions are:

  1. Can a @service class be called from another machine as a common wsdl service? For example, from a standalone app that is the client of the service.

  2. Or is @service annotation just to mark the use of a class?

Thanks


Solution

  • Annotation @Service is only a special version of @Component annotation and its purpose is not providing a remote access to implementation.

    As mentioned in documentation, @Service annotation helps the class to be auto detected during the classpath scanning (see the JavaDoc) and processed by some tools. Also check the explanation on Spring's forum.