I am getting the following error:-
{
"fault": {
"faultstring": "Failed to execute the ExtractVariables: Extract-Variables-1",
"detail": {
"errorcode": "steps.extractvariables.ExecutionFailed"
}
}
}
<ServiceCallout continueOnError="false" enabled="true" name="Service-Callout-1">
<DisplayName>Service Callout-1</DisplayName>
<Properties/>
<Request variable="myRequest">
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<Set>
<Headers>
<Header name="username">abc</Header>
<Header name="password">1234</Header>
</Headers>
</Set>
</Request>
<HTTPTargetConnection>
<Properties/>
<URL>https://35.244.239.45.nip.io/authdummy</URL>
</HTTPTargetConnection>
<Response>response</Response>
</ServiceCallout>
<ExtractVariables continueOnError="false" enabled="true" name="Extract-Variables-1">
<DisplayName>Extract Variables-1</DisplayName>
<JSONPayload>
<Variable name="result">
<JSONPath>$.message</JSONPath>
</Variable>
</JSONPayload>
<Source>response</Source>
</ExtractVariables>
<ProxyEndpoint name="default">
<PreFlow name="PreFlow">
<Request>
<Step>
<Name>Service-Callout-1</Name>
</Step>
<Step>
<Name>Extract-Variables-1</Name>
</Step>
<Step>
<Name>JavaScript-1</Name>
</Step>
</Request>
<Response/>
</PreFlow>
<Flows/>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
<HTTPProxyConnection>
<BasePath>/demo1</BasePath>
</HTTPProxyConnection>
<RouteRule name="noroute"/>
</ProxyEndpoint>
Yes, the first thing I would do, if I were you , is NOT use <Response>response</Response>
. "response" is the name of the message that gets populated by Apigee automatically when Apigee sends a message to an upstream system via a TargetEndpoint . Think of it as a "reserved" variable.
Use ANYTHING other than that variable name in ServiceCallout.
<Response>myAuthResponse</Response>
And then modify your ExtractVariables to reference that variable
<ExtractVariables continueOnError="false" enabled="true" name="Extract-Variables-1">
<DisplayName>Extract Variables-1</DisplayName>
<JSONPayload>
<Variable name="result">
<JSONPath>$.message</JSONPath>
</Variable>
</JSONPayload>
<Source>myAuthResponse</Source>
</ExtractVariables>