Service callout response status code (405) gets overridden to 200

Not applicable

Hi,

I am making a service callout to another local api-proxy which raises fault for prohibited request verb with response status code 405. But in the caller API-proxy, I am getting the calloutResponse.status.code as 200 OK. I am handling fault in the caller proxy for "Method Not Allowed" based on the calloutResponse.status.code.

How to fix the overriding of calloutResponse.status.code?

Thanks,

Raghu

0 3 1,093
3 REPLIES 3

Can you please add the necessary screenshots for the same

  1. Service Callout Policy
  2. Fault Handler where you are raising the fault
  3. Trace section

Hi Nisha,

Please find below the necessary screenshots.

1. Service-Callout from API-1(Caller API)

3974-servicecallout-from-api-1.jpg

2. RaiseFault in API-2 (Calledout API)

3975-api-2-raisefault.jpg

3. Trace in API-2 (Calledout API)

3978-api-2-trace.jpg

4. RaiseFault in API-1 (Caller API)

3980-api-1-raisefault.jpg

5. Trace in API-1 (Caller API)

3979-api-1-trace.jpg

Thanks & regards,

Raghu

Not applicable

Hi,

I found the issue. I was not providing the 'Allow' header in the RaiseFault policy.

I did following highlighted change and it worked.

3981-raisefault-allowheaderreqdfor405.jpg

Thanks & regards,

Raghu