I am using a service-callout to POST a request to a url(snippet below). The variable "queryinfo.code" in the Payload node is not getting replace by its value. How do it fix it?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ServiceCallout async="false" continueOnError="false" enabled="true" name="CallGoogleTokenurl"> <DisplayName>CallGoogleTokenurl</DisplayName> <Properties/> <Request clearPayload="true" variable="myRequest"> <Set> <Headers> <Header name="Content-Type">application/x-www-form-urlencoded</Header> </Headers> <Verb>POST</Verb> <Payload>code={queryinfo.code}</Payload> </Set> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> </Request> <Response>calloutResponse</Response> <HTTPTargetConnection> <Properties/> <URL>https://accounts.google.com/o/oauth2/token</URL> </HTTPTargetConnection> </ServiceCallout>
Solved! Go to Solution.
The above snippet does populate the payload, replacing it's value.
Look for the following variable -
ServiceCallout.request
It's a better practise to use <FormParams> tag to provide x-www-form-urlencoded values.
<FormParams> <FormParam name="code">{queryinfo.code}</FormParam> </FormParams>
What is the resulting payload?
The above snippet does populate the payload, replacing it's value.
Look for the following variable -
ServiceCallout.request
It's a better practise to use <FormParams> tag to provide x-www-form-urlencoded values.
<FormParams> <FormParam name="code">{queryinfo.code}</FormParam> </FormParams>
You can find following screenshots for the reference -
screen-shot-2016-11-11-at-71230-pm.png