Programming mediations
Several distinct tasks are involved in programming a mediation. Typically, the mediation code is written by a programmer, and is then deployed and administered by an integrator.
Code examples for writing a mediation are provided in the following topic: Add mediation function to handler code.
The following APIs are provided for you to work with messages:
- We can use the SIMessage API to manipulate the contents of the message.
- We can use the SIMediationSession API to access the service integration bus so that the mediation can send and retrieve messages.
We can deploy mediations by using tooling such as the Rational Application Developer tools.
The tasks for programming a mediation are as follows:
- Developing
- Writing a mediation by adding functional code to a mediation handler.
- Deploying
- Add a mediation to a mediation handler list, and deploying it.
- Administering
- Associate a mediation handler with a destination (Optional), and configuring the parameters to be used by the mediation handler at run time.
Take the following steps to program a mediation:
- Create a mediation handler. For more information, see Writing a mediation handler.
- Add mediation function code to the mediation handler. For more information, see Add mediation function to handler code.
- Optional: Working with the message payload, for example for logging messages within a mediation. For more information, see Work with the message payload.
- Use the Rational Application Developer tools to create a handler list, add the mediation handler to the list, and deploy the handler list as an Enterprise Archive (EAR file). See the Rational Application Developer information center for information about how to do this.
Subtopics
- Serializing the content of SIMessage
Use this task to convert an SIMessage object to a byte array.
- Writing a mediation handler
We can write a mediation handler, add mediation function to it, and prepare it for installation on an application server.
- Add mediation function to handler code
A mediation handler is a wrapper for the mediation code that operates on the message. We can add mediation function to an existing mediation handler by working with the message context, the message properties, the message header or the message payload.
- Writing a routing mediation
Use this topic to create a mediation that chooses a particular forward route for a message.
- Writing a mediation that maps between attachment encoding styles
Use this topic to create a mediation that maps from SOAP Messages with Attachments encoding style to WS-I Attachments Profile Version 1.0 encoding style.
- Choose a target service and port through a routing mediation
Write a routing mediation and configure it to select a target service and port. If we have migrated a web services gateway that included a routing filter, use this task to recreate the equivalent functions by using a mediation.
Example: Use mediations to trace, monitor and log messages