The Set Message filter replaces the body of the message.
The replacement data can be plain text, HTML, XML, or any other text-based
markup.
You can use properties representing the values of message attributes in
the replacement text to insert message-specific data into the message
body. For example, you can insert the authenticated user's ID into a
<Username> element by using the
${authentication.subject.id} property as follows:
| | |
|
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Username>${authentication.subject.id}</Username>
</soap:Header>
<soap:Body>
<getQuote xmlns="oracle.com">
<ticker>ORM.L</ticker>
</getQuote>
</soap:Body>
</soap:Envelope>
| |
| | |
|
Assuming the oracle user authenticated successfully
to the Enterprise Gateway, the message body is set to the following contents:
| | |
|
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Username>oracle</Username>
</soap:Header>
<soap:Body>
<getQuote xmlns="oracle.com">
<ticker>ORM.L</ticker>
</getQuote>
</soap:Body>
</soap:Envelope>
| |
| | |
|
You can also use the Set Message filter to customize
SOAP faults that are returned to clients in the case of a failure or
exception in the policy.
|