Library Link To Toggle Frames Print Feedback

Chapter 1. Developing a Service from a Java Class

Summary

There are many instances where you have Java code that already implements a set of functionality that you want to expose as part of a service oriented application. Using JAX-WS annotations, you can add the information needed to service enable a Java class. You can also create a Service Endpoint Interface (SEI) that can be used in place of a WSDL contract. If you want to a WSDL contract, Celtix Enterprise provides tools to generate a contract from annotated Java code.

Table of Contents

Creating the SEI
Annotating the Code
Required Annotations
Optional Annotations
Generating WSDL

To create a service starting from Java you need to do the following:

  1. Create a Service Endpoint Interface (SEI) that defines the methods you wish to expose as a service.

    [Tip] Tip

    You can work directly from a Java class, but working from an interface is the recommended approach. Interfaces are better for sharing with the developers who will be responsible for developing the applications consuming your service. The interface is smaller and does not provide any of the service's implementation details.

  2. Add the required annotations to your code.

  3. Generate the WSDL contract for your service.

    [Tip] Tip

    If you intend to use the SEI as the service's contract, it is not necessary to generate a WSDL contract.

  4. Publish the service.