Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Handling Faults

Not applicable

I just can't get my head wrapped around how to handle different faults. I need to capture the faults and send back a custom XML response to the clients. I have tried several different ways to do this but have not been able to get the custom response to be sent. I can see in the trace where the check was made but the step was skipped because the condition did not match. In this API i would need to set a couple of different fault rules. One for the schema validation and one if the target server is not available. I'm sure I will need to add more as I go along. Not sure how to set this up, any help would be greatly appreciated.

Below is my proxy endpoint and my target endpoint.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
    <Description/>
    <FaultRules/>
    <PreFlow name="PreFlow">
        <Request>
            <Step>
                <Name>Set-Content-Type</Name>
            </Step>
            <Step>
                <Name>SubscriberInquiry-Validation</Name>
            </Step>
            <Step>
                <Name>SubscriberInquiry_req</Name>
            </Step>
            <Step>
                <Name>Extract-Header-Values</Name>
            </Step>
            <Step>
                <Name>Assign-Header-Values</Name>
            </Step>
        </Request>
        <Response>
            <Step>
                <Name>SubscriberInquiry_rep</Name>
            </Step>
        </Response>
    </PreFlow>
    <PostFlow name="PostFlow">
        <Request/>
        <Response/>
    </PostFlow>
    <Flows/>
    <HTTPProxyConnection>
        <BasePath>/ejav-eps-subscriberinquiry-service</BasePath>
        <Properties/>
        <VirtualHost>default</VirtualHost>
    </HTTPProxyConnection>
    <RouteRule name="SubscriberInquiry">
        <TargetEndpoint>TargetEndpoint-SubscriberInquiry</TargetEndpoint>
    </RouteRule>
    <RouteRule name="default">
        <TargetEndpoint>default</TargetEndpoint>
    </RouteRule>
</ProxyEndpoint>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="TargetEndpoint-SubscriberInquiry">
    <Description/>
    <FaultRules/>
    <PreFlow name="PreFlow">
        <Request/>
        <Response/>
    </PreFlow>
    <PostFlow name="PostFlow">
        <Request/>
        <Response/>
    </PostFlow>
    <Flows/>
    <HTTPTargetConnection>
        <LoadBalancer>
            <Server name="ejav-eps-target-inquiry-1"/>
            <Server name="ejav-eps-target-inquiry-2"/>
        </LoadBalancer>
        <Path>/Eps/EPSHttpService</Path>
    </HTTPTargetConnection>
</TargetEndpoint>
0 5 717
5 REPLIES 5