Issue with policies on Target Endpoint flows

Since today, all the policies that I've setup for Target Endpoint Preflow are not executed anymore. They are not skipped or disabled.

Are some of you experiencing the same?

Solved Solved
0 9 432
1 ACCEPTED SOLUTION

Ahh it's simple, It's by design.

It went into error flow, that's because request failed with 404. Find more about same here.

By entering the Error flow, the proxy:

  • Bypasses any remaining processing steps, meaning any remaining policies, in the current flow
  • Bypasses any subsequent flows
  • Returns a fault response to the requesting app.

Adding below property to HTTPTargetConnection should solve the issue,

        <Properties>
            <Property name="success.codes">4xx,2xx</Property>
        </Properties>

View solution in original post

9 REPLIES 9

Dear @fabiobortoli , Strange, We don't see any issue like that. Are you sure , route rules are executing target endpoints you expect ? Can you share a screenshot / sample proxy / trace screenshot to investigate further ?

Please note that some field are masked for security reasons

I have the following policies:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="true" enabled="true" name="GetFullResponsePayload">
    <DisplayName>GetFullResponsePayload</DisplayName>
    <FaultRules/>
    <Properties/>
    <AssignVariable>
        <Name>respayload</Name>
        <Value/>
        <Ref>response.content</Ref>
    </AssignVariable>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="response"/>
</AssignMessage>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="add-cors">
    <DisplayName>Add CORS</DisplayName>
    <FaultRules/>
    <Properties/>
    <Add>
        <Headers>
            <Header name="Access-Control-Allow-Origin">*</Header>
            <Header name="Access-Control-Allow-Headers">origin, x-requested-with, accept</Header>
            <Header name="Access-Control-Max-Age">3628800</Header>
            <Header name="Access-Control-Allow-Methods">GET, PUT, POST, DELETE</Header>
        </Headers>
    </Add>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="response"/>
</AssignMessage>

Used here:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
    <Description/>
    <PreFlow name="PreFlow">
        <Request/>
        <Response>
            <Step>
                <Name>add-cors</Name>
            </Step>
            <Step>
                <Name>GetFullResponsePayload</Name>
            </Step>
        </Response>
    </PreFlow>
    <Flows/>
    <PostFlow name="PostFlow"/>
    <HTTPTargetConnection>
        <URL>https://XXXYYYZZZ</URL>
    </HTTPTargetConnection>
</TargetEndpoint>

The trace:

2886-no-pol.png

@fabiobortoli , I don't see any reason why it shouldn't work. Everything looks fine for me. Infact, I have just tested in my org with sample proxy & works as expcted. Can you pm me your org name & proxy name using "Ask An Expert" button in right side bar to investigate further ?

Done! Thanks Anil.

Hi @fabiobortoli

May be you can check the proxy end point route rules if you are having mutiple target end points. If only one target endpoint I cant think of a reason.

I confirm I have a single target end points.

Ahh it's simple, It's by design.

It went into error flow, that's because request failed with 404. Find more about same here.

By entering the Error flow, the proxy:

  • Bypasses any remaining processing steps, meaning any remaining policies, in the current flow
  • Bypasses any subsequent flows
  • Returns a fault response to the requesting app.

Adding below property to HTTPTargetConnection should solve the issue,

        <Properties>
            <Property name="success.codes">4xx,2xx</Property>
        </Properties>

That's simply great. My sincere thanks Anil

@fabiobortoli , Anytime 🙂