Index Changes

Difference between version and version     

Back to JAXW Shandlers With HTTPBC, or JAXW Shandlers With HTTPBC Info


At line 10 added 8 lines.
! How to enable JAX-WS handlers in OpenESB
In OpenESB, we allow user handler implementations to be plugged into JAX-WS runtime through HTTP BC. Here are a few things worth mentioning:
* Handlers can be implemented in Java SE project(s) or any other standalone environment, i.e. handler implementation(s) can also be compiled outside of the IDE.
* Handler is an user implemented class with the only requirement of implementing the well-defined JAX-WS handler interface (SOAPHandler, LogicalHandler, and the optimized version of the SOAPHandler called MessageHandler)
* Handler implementation and configuration does not affect the application composition, i.e. building a BPEL process which adds a webservice request message\\
handler to tweak the SOAP headers before invoking a remote service should/would not affect the BPEL logic.
* Handler configuration, i.e. the particular handler class(es) to invoke, will be done on the SOAP binding in CASA editor
\\
At line 11 changed 1 line.
* What can be done using JAX-WS handlers
! How to configure JAX-WS handlers in OpenESB
* As mentioned earlier, handlers can be configured on the SOAP binding in CASA. Since it is a port (endpoint) level configuration, the handler configuration is enabled on the SOAP\\ endpoint icon (i.e. the "greenish" and the "pupleish" arrows), as shown in the screen shot below:
\\
[{Image src='SOAPEndpointConfigEditor.png' width='' height='' align='left|center|right' }]
At line 24 added 1 line.
\\
At line 14 changed 1 line.
! How to enable JAX-WS handlers in OpenESB
* Clicking on the "..." button in the endpoint property sheet for "Handlers" will bring up the handler configuration editor:
At line 28 added 27 lines.
\\
[{Image src='HandlerConfigEditor.png' width='' height='' align='left|center|right' }]
\\
* Clicking on the "Add" button will bring up a file chooser window. From here, user can browse to a NetBeans Java SE project, or a file directory containing the jar file(s) for \\ the handler implementation and any dependency libraries, or a single jar file containing all the handler(s) and utility classes. CASA introspects the selected project folder or \\
the jar file(s) and populates the "Handler Chain" list with all the JAX-WS handlers found. Specifics of the selected handler is displayed in the "Handler Details" section.
\\
[{Image src='HandlerConfiguration.png' width='' height='' align='left|center|right' }]
\\
* Of course, the handlers can be managed in the configuration editor, which includes adding, removing and ordering handlers. It should be pretty intuitive...
! How does the handler work (in OpenESB)
Handlers can be defined to access and/or modify incoming or outgoing SOAP messages. There can be any number of handlers, and/or any combination of the legitimate handler types defined for a SOAP endpoint.\\
When there are mixed handler types defined for a given endpoint, the execution order will depend on the directionality of the message: all logical handlers will be executed \\
before the SOAP handlers on outgoing (request and/or response) messages, and SOAP handlers will be executed before logical handlers on incoming (request and response) messages.\\
When there are multiple handlers defined for the same type/group, the handlers will be executed in the order they are defined in the CASA editor.\\
Do note that handlers for a giving endpoint will be executed on the request and response processing path. JAX-WS offers message context properties to allow the user\\
implementation to selectively choose which path the handler should be applied to, if that is desired.
Sometimes, handlers can be as simple as logging/tracking the message payload. Below is your typical "Hello World" kind of sample.\\
At line 56 added 2 lines.
So as promised, we have an example of how to use handlers with OpenESB. Here we have our famous Synchronous sample, and we are going to add a couple of handlers on\\
the "provider" endpoint to log the SOAP messages.\\
At line 59 added 2 lines.
We have three projects here: the Synchronous sample project which includes the BPEL and the Composite Application projects, and the Java SE project which has the handler implementations.\\
Not much to be said about the Synchronous sample. The Java SE project has two handlers implemented: a SOAP handler that logs the entire SOAP message, and a logical handler that\\ logs just the message payload (i.e. the payload in the SOAP body)
At line 62 added 1 line.
All three projects are included here in the [Handler_Sample.zip | Handler_Sample.zip].
At line 65 added 3 lines.

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-18) was last changed on 14-Sep-09 17:49 PM, -0700 by Sherry Weng