I have created a proxy with no endpoint . At proxy endpoint postflow ,I have added a service callout policy name ‘ServiceCallout-GetBaasToken’ with response ‘GeocodingResponse’.I have given a http target endpoint in the servicecallout policy.When I am testing I am getting response code 200 and I can see response in trace logs under ‘servicecallout.response’ ,but I am not able to see the final response in browser or api console testing tool.Here are the details.
It’s because Your target server is No-Target & you haven’t overridden the target response. You need to use Assign Message Policy to override default target response. Any reason why you are using service callout instead of above url in service callout as target endpoint ?
Hi Anil,Many thanks for your suggestion.I am trying to call service ‘sqlrest/CUSTOMER/3’ using service callout policy to ensure that service can be called or not.My doubt is if service callout policy can handle response object .I should get the final response right .Let me try by override the target endpoint using ‘Assign message policy’ .I will come back to you ,if I have any further questions.
Hi Anil,As you suggested I have added 'ExtractVariable’policy to extract data from servicecall out response and ‘Assignmessage’ policy to display final response.During ‘ExtractVariable’ policy execution I have used correct XPATH ,but not able to get the value.
Here are the details.(Note:I did everything at the proxyendpoint postflow)
@veeraraghavendra , Just wondering, Why are you using service callout at first ? Why don’t you specify target endpoint while creating proxy instead of No-Target ?
I think you need to use the assign message policy to setup the final response payload body using the GeocodingResponse which you got from the callout policy.
Make sure after that do not clear the payload by using other policies.