If response code is other than 200 from downstream service, Internal service response template response is not received at External API
search cancel

If response code is other than 200 from downstream service, Internal service response template response is not received at External API

book

Article ID: 263030

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

I have created an External Web API which calls an Internal web API to route the call to a further downstream service. 

What I have observed is that when a response code other than 200 from the downstream service is received, the Internal service response template response is not received at the External API.

Do you know if we have to handle anything separately for this ?

 

Environment

Release : 10.1

Cause

one of the services (the Downstream service) has the HTTP(S) Routing Properties set  as “Fail if target returns error status (>= 400)"

Resolution

the policy needs to be modified and tested to fix the logic flow and obtain the expected results. 

1. The Main Policy is composed of  2 levels (2 policies):
   a. Employer_RoutingService
   b. MDB_CompanyDetail

2. Employer_RoutingService,  the HTTP(S) Routing Properties has the “Assertion Outcome” set as 
  “Never fails as long the target returns answer”

However , reviewing the  “MDB_CompanyDetail” service/policy, the HTTP(S) Routing Properties had set
Fail if target returns error status (>= 400).
Suggestion was to change the “Assertion Outcome” on this service to "Never fail as long as target returns an answer"

3. Tested the policy again after that change and now got the 400 Error Response as needed.