Question

I have an existing application (say 'A') and I want to call a java function of this app from another app 'B'.

I don't want to put dependency of this app('A') in my calling application('B') to avoid running 'A' at multiple places.

We thought of exposing 'A's function as a web service, which can be called by 'B' by putting dependency on the 'A's client.

What is the efficient and easy way to do this.

Thanks in advance.

Était-ce utile?

La solution

Depending on the type of service:

  • SOAP service: JAX-WS
  • RESTful service: JAX-RS, Spring-MVC

Either way, you put a couple of annotations on your class, and configure the framework to expose the service (refer to the documentation of whichever you choose)

Autres conseils

Have a look at Jax-WS. I don't know what's easier :D You can annotate methods with @WebMethod and deploy your work onto a application server - and there you go!

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top