IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Enterprise Service Bus programming > Imports and exports
Data handler
Data handlers are reusable transformation logic in WebSphere ESB, which can be used by exports and imports. Data handlers can transform native formats into business data and from business data into native formats required by external services.
In your SOA implementation, business data can flow between service providers and service requesters over a variety of protocols (HTTP, JMS, MQ, and so on), in a variety of data formats such as comma separated value, delimited, fixed width, COBOL and so on. Different protocols can have the same mechanisms for carrying the business data in their respective protocol envelope.
For example, a HTTP message can encode its data using a comma delimited format, which can also be used in a JMS message.
To allow imports and exports to process these multiple data formats, data handlers are used to translate request and response data. SCA modules handle data as business objects. Data handlers need to convert message data to and from business objects. Data Handlers can optionally contain configurations such as codepage information for further flexibility. They can also be defined at different levels of granularity allowing specific data handling.
The data handler defined at the binding level is used by default, so every invocation of that export or import uses the same data handler. If specified, the interface level and the operation level data handlers take preference. WebSphere ESB provides the following data handlers:
- XMLDataHandler for handling XML formats
- Delimited for delimited formats including comma separated values
- FixedWidth
- JSON
- SOAP
- Serialized Java Object
- JAXB for conversion to Java Beans
- Handled by WTX for delegating data transformation to WebSphere Transformation Extender
- MQ Adapter language data binding generator
- JMS Adapter language data binding generator
- Service Gateway for using business objects that leave the message data unparsed
An API is provided for custom data handlers to be written. These are implemented with a Java class that implements the commonj.connector.runtime.DataHandler interface.