Service Callout timeout FaultRule not honored

I have a policy that times out but does not honor an un-conditional FaultRule.

Is there anything wrong with the following Callout policy?

<ServiceCallout ....
    <FaultRules>
        <FaultRule>
            <Step>
                <Name>MyAssignMessagePolicy</Name>
            </Step>
        </FaultRule>
    </FaultRules>
    <Request clearPayload="false">
        <Set>
            <Payload contentType="application/json">{"Username":"joe"}</Payload>
            <Verb>POST</Verb>
        </Set>
    </Request>
    <Response>LBTokenResponse</Response>
    <HTTPTargetConnection>
        <URL>https://unreliable.com</URL>
    </HTTPTargetConnection>
</ServiceCallout>

I have tried using the DefaultFaultRule as well. But still I receive this timeout error message:

  "fault": {
    "faultstring": "Execution of ServiceCallout GetLBTranslationToken failed. Reason: timeout occurred in GetLBTranslationToken",
    "detail": {
      "errorcode": "steps.servicecallout.ExecutionFailed"

Any help/suggestions appreciated.

Michael

Solved Solved
0 2 427
1 ACCEPTED SOLUTION

@michaelmcdowell,

You can't have the FaultRule inside the Service Callout policy. Please refer to the documentation on Service Callout policy on what elements and attributes can be configured. You should have the FaultRule configured either in your Proxy/Target Endpoint depending on where you want to execute the Service Callout policy.

The Learn Edge example shows you how to check the HTTP code in a Service Callout response and throw a custom exception based on the value of the code.

You can also refer to the community post How to pass through ServiceCallout response content in FaultRule? to know more about handling errors from Service Callout policy.

Regards,

Amar

View solution in original post

2 REPLIES 2

@michaelmcdowell,

You can't have the FaultRule inside the Service Callout policy. Please refer to the documentation on Service Callout policy on what elements and attributes can be configured. You should have the FaultRule configured either in your Proxy/Target Endpoint depending on where you want to execute the Service Callout policy.

The Learn Edge example shows you how to check the HTTP code in a Service Callout response and throw a custom exception based on the value of the code.

You can also refer to the community post How to pass through ServiceCallout response content in FaultRule? to know more about handling errors from Service Callout policy.

Regards,

Amar

@AMAR DEVEGOWDA,

Thanks for the steer and the link. All is well now.

M