Execution of ServiceCallout failed

I am using below Service Callout to call another proxy which is in same environment. The SC policy is placed in Default Preflow Proxy endpoint.

The code is as below. But I am getting error as below

 

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="Service-Callout-1">
    <DisplayName>Service Callout-1</DisplayName>
    <Properties/>
    <Response>myResponse</Response>
    <LocalTargetConnection>
        <APIProxy>MMCWDCC_Active_EE</APIProxy>
        <ProxyEndpoint>default</ProxyEndpoint>
    </LocalTargetConnection>
</ServiceCallout>


I also tried setting the VERB

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="Service-Callout-1">
    <DisplayName>Service Callout-1</DisplayName>
    <Properties/>   
    <Request>
        <Set>
            <Verb>GET</Verb>
            <Path>/v1/active_ee</Path>
        </Set>
    </Request>
    <Response>myResponse</Response>
    <LocalTargetConnection>
        <APIProxy>MMCWDCC_Active_EE</APIProxy>
        <ProxyEndpoint>default</ProxyEndpoint>
    </LocalTargetConnection>
</ServiceCallout>

 

 

 

 

{
    "fault": {
        "faultstring": "Execution of ServiceCallout Service-Callout-1 failed. Reason: ResponseCode 401 is treated as error",
        "detail": {
            "errorcode": "steps.servicecallout.ExecutionFailed"
        }
    }
}

 

 

0 4 695
4 REPLIES 4

My first step would be to trace the MMCWDCC_Active_EE and see if the request is landing with the proxy and if so which step is generating the 401.

Hi David,

Do you mean to test the proxy 'MMCWDCC_Active_EE' independently.

I did execute this proxy independently before doing SC. It run successfully with 200 status.

 

I would trace the proxy when it is being invoked as a service callout then as my next step. Likely a header is getting stripped or some other key variable is being omitted in the callout.

Simple trace should able to resolve the issue.Looking at the error it seems you are missing auth to backend. May be you will need to add Authorization Header so that backend will validate?

General links on troubleshooting:

https://docs.apigee.com/api-platform/troubleshoot/policies/runtime/service-callout-runtime-errors#ca...

https://docs.apigee.com/api-platform/troubleshoot/apigee-edge-error-messages#runtimeerrors