First, your title “ServiceCallout gave no response to extract variables policy”, I think is unfounded. It’s not the case that the servicecallout did not “give” a response to extract variables. The way to think about it is, ServiceCallout will populate a variable with the contents of the HTTP response. I think Your desire is to use ExtractVariables to extract a subset of that response into additional context variables. So I suppose an appropriate title would be something like “My ExtractVariables policy is not extracting as I hoped it would”
The combination of ServiceCallout (SC) and a subsequent ExtractVariables (EV) is really common. Many customers use this and it works well. Why you would be seeing surprising results, is probably because the configuration for the respective policies is not synchronized. Not consistent.
Your ServiceCallout looks fine, I guess.
The EV policy you have will work with that SC policy, IF AND ONLY IF
the response is a JSON type ( GeocodingResponse.header.content-type = “application/json” or similar)
The response has elements named “origin_addresses” and “rows”.
The EV policy is attached in such a way that it executes after the ServiceCallout policy
Have you checked all that?
The one critical piece of information you haven’t shared is the shape of the payload that is returned by the ServiceCallout. What does it look like?
Your ExtractVariables policy looks fine against the JSON you provided. To double-check I’ve just tested your ExtractVariables policy against a manually hardcoded GeocodingResponse variable and it worked fine.
In the first case, it’s not correctly configured, but the target invocation does succeed (because you’re passing the proxy request parameters which contain everything needed (destinations, origins, units, key)
If all you want to do is invoke this API once, just remove the service callout and move the ParseGeocodingResponse to the response (Make sure to use response as the source element and not the variable you were using before)
If however you want to do this as a service call out , you’ll need to fix the way you’re assigning the service callout request. Pay attention to the error returned in the service callout:
ServiceCallout.response
{ “destination_addresses” : , “error_message” : “You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to Google Maps Platform - 3D Mapping & Geospatial Analytics”, “origin_addresses” : , “rows” : , “status” : “REQUEST_DENIED” }
You’re missing the key parameter in the callout request!