Mediators
In WSO2, a mediator is a piece of code that has a logical behavior and a final purpose for using it, having an XML structure. By default, we have a list of mediators that we can use Out of the Box, but we can also develop a custom mediator to extend the default functionality.
When we have a set of mediators that perform an action together, it's called sequences: We can use it in Proxies and APIs.
The property mediator
A property is a variable that stores some information during a time that depends on the scope it has configured.
Here's the syntax:
<property name="string" [action=set|remove] [type="string"] (value="literal" | expression="xpath") [scope=default|transport|axis2|axis2-client] [pattern="regex" [group="integer"]]> <xml-element/>? </property>
We have three different types of properties:
- Static: Get a static value in the creation:
<property name="color" value="red" />
- Dynamic: Get a dynamic value:
- From an
xpath
expression:
- From an
<property name="dynamic1...