My scenario is calling a service B with some parameters that are passed in the request query string. I have to introduce a service callout in the preflow to call service A with those parameters set in AssignMessagePolicy, get the response of A and extract the required fields using ExtractVariables policy and pass them to service B. I have done with what all required but the flow fails as service callout to service A is not having query string parameters in the url though they were set in ASsignMessagePolicy.
AssignMessagePolicy to service A:
API V1 Request InitializeAPIRequest {request.queryparam.apiKey} {request.queryparam.applicationId} {request.queryparam.twoDigitISOLanguageCode} {request.queryparam.twoDigitISOCountryCode} GET apiKey request.queryparam.apiKey applicationId request.queryparam.applicationId twoDigitISOLanguageCode request.queryparam.twoDigitISOLanguageCode twoDigitISOCountryCode request.queryparam.twoDigitISOCountryCode
It worked like a gem. How to get the final response from service B? Now the service A issue is resolved but service B is successful but the response(supposed to be json document) is not shown. What should I do?
There is only one external service call and hence one service call out should be there and its response is used for the real request api call from client. I don’t want to use two service call outs. Does it makes sense?
I think so, you mentioned Service A then Service B so I prototyped as a “No Target” API with 2 Service Callouts.
If your using a “Reverse Proxy” API with one or more target endpoints, then each conditional flow would need to use an Assign Message with AssignTo of type “request”.