Loading JAX-WS handler classes
A JAX-WS handler interacts with messages through a JAX-WS based Version 7.0 WS-Notification service point (for inbound invocation handling) or WS-Notification service (for outbound invocation handling), therefore you must make the handler class available to the server or cluster that hosts the WS-Notification service point or service to monitor.
This task assumes that we have already created the handler. We can do this by using IBM Rational Application Developer or a similar tool.
Before we can configure a JAX-WS handler for use with WS-Notification, you must make the handler class available to the server or cluster that hosts the WS-Notification service point or service to monitor. To do this, we create a shared library for the class then add the shared library to the class loader for the server.
- Package the class file for the handler as a JAR file, then copy the JAR file into a directory.
Make the handler class available to the application server in one of the following ways:
- Copy the individual class file into a directory structure under app_server_root/classes that matches the package name of the class, where app_server_root is the root directory for the installation of WAS. For example a handler class com.ibm.jaxws.handler.TestHandler is copied into the app_server_root/classes/com/ibm/jaxws/handler directory.
- Package the class files for all the handlers as a JAR file, then copy it into the app_server_root/lib/app directory.
- Start the administrative console.
- Create a shared library for the JAR file.
- Navigate to Environment -> Shared libraries.
- Set the scope at which we want the new library to be visible, then click New.
- Give the new library a name.
- Set the class path to the directory and file name for the handler JAR file.
- Save the changes to the master configuration.
For more information, see Create shared libraries.
- Create a class loader for the server or cluster on which to make the JAR file available.
For more information, see Configure class loaders of a server.
- Navigate to Servers -> Server Types -> WebSphere application servers -> server_name -> [Server Infrastructure] Java and Process Management -> Class loader.
- Click New.
- Click OK.
- Save the changes to the master configuration.
- Add the shared library to the class loader for the server.
For more information, see Associate shared libraries with servers.
- Navigate to Servers -> Server Types -> WebSphere application servers -> server_name -> [Server Infrastructure] Java and Process Management -> Class loader -> class_loader_name > [Additional Properties] Shared library references.
- Click Add.
- Click on the name of the new library, then click OK.
- Save the changes to the master configuration.
What to do next
We are now ready to create a new JAX-WS handler configuration using the administrative console or using the createJAXWSHandler command.
Related concepts
WS-Notification
Related tasks
Use WS-Notification for publish and subscribe messaging for web services Secure WS-Notification
WS-Notification troubleshooting tips createJAXWSHandler command modifyJAXWSHandler command
Related information:
Create a new JAX-WS handler configuration Create a new JAX-WS handler list