JAX-WS Annotated Services from Java - 7.3

Talend ESB Service Developer Guide

Version
7.3
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend ESB
Talend Runtime
Content
Design and Development
Installation and Upgrade
Last publication date
2023-04-17

The JAX-WS APIs include a set of annotations which allow you to build services using annotated classes. These services are based on a single class which contains a set of operations.

Here's a simple example:

@WebService
public class Hello {
   public String sayHi(String name) {
      return "Hello " + name;
   }
}

JAX-WS includes many more annotations as well such as:

  • @WebMethod - allows you to customize the operation name, exclude the operation from inclusion in the service, etc

  • @WebParam - allows you to customize a parameter's name, namespace, direction (IN or OUT), etc

  • @WebResult - allows you to customize the return value of the web service call

Data is marshalled from XML to Java and vice versa via the JAXB data-binding.

Services are publish via one of two means:

  • The JAX-WS standard Endpoint APIs

  • CXF's XML configuration format - i.e. <jaxws:endpoint ... />