0

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.

instanceOfObject
  • 2,936
  • 5
  • 49
  • 85

2 Answers2

2

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)

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
1

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!

Matthias Bruns
  • 899
  • 8
  • 13