If you search in this forum you will come across a good number of links which explain this. For example there are a number of community articles (mainly written by Scott Macdonald from Adobe) that provide step by step guidance. Here's one that describes an approach using JAX-WS. It also has a link to another that uses Apache CXF and I have read others that use a RESTful approach (JAX-RS) :-