Capture Raise fault message in message logging policy

Hi,

I am capturing error cases and raising a fault based on specific conditions. I also want to log the raise fault message in message logging policy

Raise Fault

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RaiseFault async="false" continueOnError="false" enabled="true" name="RaiseFault">
    <DisplayName>RaiseFault</DisplayName>
    <Properties/>
    <FaultResponse>
        <Set>
            <Headers>
                <Header name="Content-Type">application/xml</Header>
            </Headers>
            <Payload contentType="application/xml" variablePrefix="%" variableSuffix="#">
                <env:Envelope
                    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
                    <env:Header/>
                    <env:Body>
                        <env:Fault
                            xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                            <faultcode>%fault_code#</faultcode>
                            <faultstring>%fault_string#</faultstring>
                        </env:Fault>
                    </env:Body>
                </env:Envelope>
            </Payload>
            <StatusCode>500</StatusCode>
        </Set>
    </FaultResponse>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</RaiseFault>

How can I log the above fault message raised by RaiseFault policy in the message logs ?

Thanks

0 2 512
2 REPLIES 2

Not applicable

@Ramnath

You can do that so using message logging policy in <PostClientFlow>.

I have added a condition and it state as when ever error.state have some value this policy will always execute.

<PostClientFlow>
        <Response>
            <Step>
                <Name>MessageLogging</Name>
                <Condition>(error.state != null)</Condition>
            </Step>
        </Response>
</PostClientFlow>

Also you can define Message type, data etc in the logging policy.

dont think this is what they were asking. they want to log the message that comes from the raise fault in the messagelogging policy