Skip to main content

Annotating the Code

JAX-WS relies on the annotation feature of Java 5. The JAX-WS annotations are used to specify the metadata used to map the SEI to a fully specified service definition. Among the information provided in the annotations are the following:

  • The target namespace for the service.

  • The name of the class used to hold the request message.

  • The name of the class used to hold the response message.

  • If an operation is a one way operation.

  • The binding style the service uses.

  • The name of the class used for any custom exceptions.

  • The namespaces under which the types used by the service are defined.

    Information noteNote: Most of the annotations have sensible defaults and do not need to be specified. However, the more information you provide in the annotations, the better defined your service definition. A solid service definition increases the likely hood that all parts of a distributed application will work together.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!