Skip to main content
Skip table of contents

Build Message

The Build Message policy provides a way to build the various parts of a message using the Context Variables available in the flow. 

Various parts of the request such as Payload, Target URL, Headers, Query parameters and Form parameters can be modified using this policy. The populated message can then be sent to the Target Server or to a Service Call Out policy for invocation. Similarly, the response to be sent back to the client can be customized using this policy.

Default Convention

The variables can be referred to using this convention by default { Variable Name }

Working with JSON

The prefix and suffix to define a variable can be configured. To build JSON request/response, the symbols < (less than symbol) and > (greater than symbol) are preferred as variable prefix and suffix respectively.

Configuration

The properties that have to be configured to use the policy are described below.


Figure 1: Assign Message Policy Configuration attributes

PropertyDescription
Ignore Unresolved VariablesIf any of the variables being used as part of the configuration are not present in the incoming message, this property is used to determine whether the condition needs to be ignored or treated as an error. When set to true, the flow continues as usual. Otherwise, an error is sent back to the client reporting that the property is missing.

Show Expert

Click the Show Expert option to configure properties in the table below.


Figure 2: Assign Message Policy Expert properties Configuration attributes

PropertyDescription
Variable Reference PrefixShort prefix for the variable. For example, to build a JSON request, the symbol "<" (less than symbol) is preferred.
Variable Reference SuffixShort suffix for the variable. For example, to build a JSON response, the symbol ">" (greater than symbol) is preferred.
Use this prefix instead of Policy Scope

By mentioning this prefix, one can choose the scope of Query parameters, Headers, Form parameters (mentioned in Set Message Details tab (see the Set Message Details section below) which should be modified.

  • Proxy/Target
  • Request/Response

Leaving this empty implies by default, considers that scope in which the policy is added. 

Payload

Provide Payload content in the Payload editor.

Set Message Details


Figure 3: Set Message details

PropertyDescription
Content TypeThe content type of the message to be sent to the server can be set using this Header.
VersionHTTP version of the outgoing request to the target Server.
VerbThe HTTP method to be invoked on the target server.
Status CodeThe HTTP response Code to be returned to the Proxy client.
Remove Message Details

Removes specified elements from the message variable specified. This is used to filter unwanted elements from an incoming message.


Figure 4: Remove Message Details

Examples

REST to SOAP Conversion

This policy is used in the automatic conversion of SOAP web services to RESTful services by the tool. It converts the incoming REST request into the SOAP request by making the following changes. 

  • The SOAP envelope is added around the query parameters passed using the Payload Section.
  • SOAPAction attribute is added using the Add Message Details section.
  • All query parameters and the Content-Length header of the Proxy request are removed using the Remove Message Details section above.

Customizing API Request/Responses

In the example Customizing API Response, the JSON response that is expected by the client is built using this policy.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.