Creating and editing JAX-WS web service handlers

You can add JAX-WS logical or protocol handlers to intercept inbound and outbound messages to or from web services and their clients. You can select from any currently available JAX-WS web services and clients and launch the Handler Creation Wizard dialog where you can provide the class name of the handler, the handler name, and an optional display name, and specify the type of handler, either logical or protocol. When finished, the wizard will generate the skeleton handler code and update the applicable deployment descriptor.

About this task

The Handler Creation Wizard helps you:

Add or edit service-side handlers

Procedure

  1. Open the Services view.
  2. From the JAX-WS tree, select your web service. Right-click and select Configure JAX-WS Web Service Handlers.
  3. If handlers are already defined for the service, you can delete or reorder them. You can also add a new handler by clicking New.
    1. Select if you want to create a new handler class or select an existing one.
    2. Enter or browse to the fully-qualified class name for the handler.
    3. Enter a name for the handler.
    4. Enter a display name for the handler (optional).
    5. Select if the handler type will be logical or protocol.
    6. The output folder for the handler is listed. By default this is the src folder for the service.

Add client-side handlers

About this task

Procedure

  1. Open the Services view.
  2. From the JAX-WS tree, select your web service client. Right-click and select Configure JAX-WS ClientHandlers.
  3. If handlers are already defined for the client, you can delete or reorder them. You can also add a new handler by clicking New.
    1. Browse to the fully-qualified class name for the handler.
    2. Enter a name for the handler.
    3. Enter a display name for the handler (optional).
    4. Select if the handler type will be logical or protocol.
    5. The output folder for the handler is listed. By default this is the src folder for the client.

Test web service handlers

Procedure

  1. Modify the generated handler classes (such as by adding println).
  2. Launch the web service client sample JSP and test the web services. The handlers should intercept the traffic correctly.

Feedback