Contents

Popular
 Contents

The Build Message policy provides a way to build the various parts of the 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

Icon

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

Working with JSON

Icon

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
Create NewChoose the boolean value—true or false (false is the default value). Change the value to 'true' to create a new message instead of modifying the designated message.
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 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.
Variable Reference PrefixShort prefix for the variable. For example, to build JSON request, the symbol "<" (less than symbol) is preferred.
Variable Reference SuffixShort suffix for the variable. For example, to build JSON response, the symbol ">" (greater than symbol) is preferred.
Payload

Provide Payload content in the Payload editor.

Add Message Details

This tab is used to add Headers, Query parameters and Form parameters; add names and values under the respective section by clicking Add  button.

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.
Reason PhraseThe Reason phrase corresponding to the HTTP Response.


Remove Message Details

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

Examples

REST to SOAP Conversion

The policy is used in automatic conversion of SOAP web services to RESTful services by the tool. It converts the incoming REST request into 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 Proxy request are removed using the Remove Message Details Section.

Customizing API Request/Responses

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


Adaptavist ThemeBuilder EngineAtlassian Confluence