Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Assign Message policy examples
<AssignMessage name="create1">
<AssignTo type="[request]/response" createNew="[true]/false">sc.request</AssignTo>
<IgnoreUnresolvedVariables>true/[false]</IgnoreUnresolvedVariables>
// allow any order
<Copy source="request"> // if no children do copy all
<Headers>
<Header name="h1"/>
<Header name="h2"/>
</Headers>
<QueryParams>
<QueryParam name="q1"/>
<QueryParam name="q2"/>
</QueryParams>
<FormParams>
<FormParam name="f1"/>
<FormParam name="f2"/>
</FormParams>
<Payload>true/[false]</Payload>
<Verb>true/[false]</Verb>
<Path>true/[false]</Path>
</Copy>
<Remove> // if no children do remove all
<Headers>
<Header name="h1"/>
<Header name="h2"/>
</Headers>
<QueryParams>
<QueryParam name="q1"/>
<QueryParam name="q2"/>
</QueryParams>
<FormParams>
<FormParam name="f1"/>
<FormParam name="f2"/>
</FormParams>
<Payload>true</Payload>
</Remove>
<Add>
<Headers>
<Header name="h1">my{variable.v1}</Header>
</Headers>
<QueryParams>
<QueryParam name="q1">my{variable.v1}</QueryParam>
</QueryParams>
<FormParams>
<FormParam name="f1">my{variable.v1}</FormParam>
</FormParams>
</Add>
<Set>
<Headers>
<Header name="h1">my{variable.v1}</Header>
</Headers>
<QueryParams>
<QueryParam name="q1">my{variable.v1}</QueryParam>
</QueryParams>
<FormParams>
<FormParam name="f1">my{variable.v1}</FormParam>
</FormParams>
<Payload contentType="text/xml">
<root>this is my payload {variable.v1}</root>
</Payload>
<Verb>${variable.v1}</Verb>
<Path>abc/def/{varaiable.v1}/d</Path>
</Set>
<AssignVariable>
<Name>response.header.xyz</Name>
<Ref>request.queryparam.abc</Ref>
<Value>hello!</Value>
</AssignVariable>
</AssignMessage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.