Wednesday, February 26, 2014

Helping Your Customers Help Themselves

If you tell your customers whether they are sending a certificate you can solve their problem for a day, but if you provide them with a service that tells them if they are sending a certificate you can solve their problems for a lifetime (or at least a little more often).

See my "Diagnostic Service" post for the Layer 7 policy logic for a REST service that informs the requester of the following common client mistakes:
  • Failing to use a secure (SSL) connection
  • Failing to attach a client certificate to their request
    • This can easily be changed to test for other authentication methods
  • Sending a client certificate that is expired
    • For this you have to check what the audit code was that failed the require ssl with client certificate assertion because the certificate properties are not populated when the assertion fails in earlier versions of the gateway (though I believe Layer 7 Technologies may have corrected this).
  • Sending an otherwise invalid certificate; these errors are not differentiated from each other in the policy example provided.
    • Not provisioned for use as a client certificate (not sure if this actually fails the assertion)
    • Self signed un-trusted root, etc.
Because I have crafted it as a REST service I setup the responses as JSON, but you can convert them to XML for SOAP clients and have them repoint any applications they are having trouble with in order for them to test without any assistance; they just have to look at the response they receive to validate whether or not they are properly sending their certificate (and that they are sending the one they expect to be).  Since it is REST it has no WSDL to validate their operations against and will therefore service traffic regardless of message content.

Sunday, February 16, 2014

Querying a Database from Layer 7 Policy

If you want to service requests through Layer 7 policy logic instead of routing to an application backend then you'll probably want to communicate with a database at some point.

The first thing you should get is a service account with appropriate level of access to the database in question.  The account should be added to the stored passwords in the Layer 7 environment; remember that you will need to use it via a context variable.

Then create a JDBC connection, select your driver, and set the URL appropriately.  The following example connects to the Layer 7 database (assuming the policy is running on your Layer 7 database node) over the default MySql TCP port.

jdbc:mysql://localhost:3306/ssg?sessionVariables=TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

The session variables above set the execution context to read only and non-locking; equivalent to MSSql hint "with (nolock)".

In the connection manager set the username of your service account and the context variable for the password (${secpass.[name].plainetext}).

Now your connection is ready to be used to query your database.  Within your policy add the Perform JDBC Query assertion and select the connection you have just created.

Saturday, February 8, 2014

Route failure message parsing fragment template

<?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
    <wsp:All wsp:Usage="Required">
        <wsp:All wsp:Usage="Required">
            <L7p:AuditDetailAssertion>
                <L7p:Detail stringValueReference="inline"><![CDATA[Routing Status: ${routingStatus};
Response Content Type: ${response.contentType}]]></L7p:Detail>
            </L7p:AuditDetailAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="http://www.iana.org/assignments/http-status-codes/http-status-codes.xml"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="meaningful failure modes for route assertion (fault.code)"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="1: failure occured before request was send to the backend"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="2: request was routed but no response was recieved"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="3: bad response from the backend"/>
            </L7p:CommentAssertion>
            <L7p:assertionComment>
                <L7p:Properties mapValue="included">
                    <L7p:entry>
                        <L7p:key stringValue="RIGHT.COMMENT"/>
                        <L7p:value stringValue="//Informational"/>
                    </L7p:entry>
                </L7p:Properties>
            </L7p:assertionComment>
        </wsp:All>
        <wsp:All wsp:Usage="Required">
            <L7p:SetVariable>
                <L7p:Base64Expression stringValue="MA=="/>
                <L7p:VariableToSet stringValue="fault.code"/>
            </L7p:SetVariable>
            <L7p:SetVariable>
                <L7p:Base64Expression stringValue="VW5hYmxlIHRvIGxvY2F0ZSBlcnJvciBkZXRhaWxzLg=="/>
                <L7p:VariableToSet stringValue="failure.messageText"/>
            </L7p:SetVariable>
            <L7p:SetVariable>
                <L7p:Base64Expression stringValue="NTAw"/>
                <L7p:VariableToSet stringValue="fault.status"/>
            </L7p:SetVariable>
            <L7p:SetVariable>
                <L7p:Base64Expression stringValue="VW5kZWZpbmVkIGVycm9yIG9jY3VyZWQu"/>
                <L7p:VariableToSet stringValue="fault.string"/>
            </L7p:SetVariable>
            <L7p:SetVariable>
                <L7p:Base64Expression stringValue="UGxlYXNlIGNhbGwgdGhlIGhlbHAgZGVzayBmb3IgYXNzaXN0YW5jZS4="/>
                <L7p:VariableToSet stringValue="fault.detail"/>
            </L7p:SetVariable>
            <L7p:assertionComment>
                <L7p:Properties mapValue="included">
                    <L7p:entry>
                        <L7p:key stringValue="RIGHT.COMMENT"/>
                        <L7p:value stringValue="//default values"/>
                    </L7p:entry>
                </L7p:Properties>
            </L7p:assertionComment>
        </wsp:All>
        <L7p:ForEachLoop L7p:Usage="Required"
            loopVariable="audit.details" variablePrefix="this">
            <wsp:OneOrMore wsp:Usage="Required">
                <wsp:All wsp:Usage="Required">
                    <L7p:ComparisonAssertion>
                        <L7p:CaseSensitive booleanValue="false"/>
                        <L7p:Expression1 stringValue="${this.current.messageId}"/>
                        <L7p:Operator operatorNull="null"/>
                        <L7p:Predicates predicates="included">
                            <L7p:item dataType="included">
                                <L7p:Type variableDataType="string"/>
                            </L7p:item>
                            <L7p:item binary="included">
                                <L7p:Operator operator="GT"/>
                                <L7p:RightValue stringValue="4030"/>
                            </L7p:item>
                            <L7p:item binary="included">
                                <L7p:Operator operator="LT"/>
                                <L7p:RightValue stringValue="4050"/>
                            </L7p:item>
                        </L7p:Predicates>
                    </L7p:ComparisonAssertion>
                    <wsp:OneOrMore wsp:Usage="Required">
                        <wsp:All wsp:Usage="Required">
                            <L7p:assertionComment>
                                <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//event 4038: bad http code response from backend"/>
                                    </L7p:entry>
                                </L7p:Properties>
                            </L7p:assertionComment>
                        </wsp:All>
                        <wsp:All wsp:Usage="Required">
                            <L7p:assertionComment>
                                <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//event 4041: timeout"/>
                                    </L7p:entry>
                                </L7p:Properties>
                            </L7p:assertionComment>
                        </wsp:All>
                        <wsp:All wsp:Usage="Required">
                            <L7p:ComparisonAssertion>
                                <L7p:CaseSensitive booleanValue="false"/>
                                <L7p:Expression1 stringValue="${this.current.messageId}"/>
                                <L7p:Operator operatorNull="null"/>
                                <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:RightValue stringValue="4042"/>
                                    </L7p:item>
                                </L7p:Predicates>
                            </L7p:ComparisonAssertion>
                            <L7p:SetVariable>
                                <L7p:Base64Expression stringValue="JHt0aGlzLmN1cnJlbnQubWVzc2FnZUlkfQ=="/>
                                <L7p:VariableToSet stringValue="fault.code"/>
                            </L7p:SetVariable>
                            <L7p:SetVariable>
                                <L7p:Base64Expression stringValue="JHt0aGlzLmN1cnJlbnQucGFyYW1zWzFdfQ=="/>
                                <L7p:VariableToSet stringValue="failure.messageText"/>
                            </L7p:SetVariable>
                            <L7p:Split>
                                <L7p:InputVariable stringValue="failure.messageText"/>
                                <L7p:OutputVariable stringValue="failure.messageText"/>
                                <L7p:SplitPattern stringValue=":"/>
                                <L7p:SplitPatternRegEx booleanValue="false"/>
                            </L7p:Split>
                            <wsp:OneOrMore wsp:Usage="Required">
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue="Received fatal alert: unexpected_message"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="Received fatal alert: unexpected_message"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//Cannot establish trust with backend server."/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue="java.security.cert.CertificateException: Certificate path validation and/or revocation checking failed. Caused by: Certificate path validation and/or revocation checking failed"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="Certificate path validation and/or revocation checking failed"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//Certificate path validation and/or revocation checking failed"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue="Unable to obtain HTTP response from https://your.server.com/service/endpoint.asmx: Host name does not match certificate 'your.server.com'."/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="Host name does not match certificate"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//Host name does not match certificate"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue="Unable to login using gateway configured account."/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="unsupported_certificate"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//Received fatal alert,  unsupported_certificate"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue="Received close_notify during handshake"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="close_notify"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//Received close_notify during handshake"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue=" Timeout when connecting to host 'your.server.com'. Caused by"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="Timeout when connecting to host"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//Timeout when connecting to host"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue=" The host did not accept the connection within timeout of 1 ms. Caused by"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="The host did not accept the connection"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//The host did not accept the connection"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue=" Unknown host"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="Unknown host"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//Unknown host"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue="Multipart stream ended before a terminating boundary was encountered"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="Multipart stream ended before a terminating boundary was encountered"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//Multipart stream ended before a terminating boundary was encountered"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue="Unable to read stream: the specified maximum data size limit would be exceeded"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="Unable to read stream"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//the specified maximum data size limit would be exceeded"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue="Unable to obtain HTTP response from https://your.server.com:443/service/endpoint: Read timed out"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="Read timed out"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//Read timed out"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue=" Connection reset"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="Connection reset"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//Connection reset"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue=" The server your.server.com failed to respond with a valid HTTP response"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="failed to respond with a valid HTTP response"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//failed to respond with a valid HTTP response"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <wsp:All wsp:Usage="Required">
                                    <L7p:CommentAssertion>
                                    <L7p:AssertionComment assertionComment="included">
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="LEFT.COMMENT"/>
                                    <L7p:value stringValue="/*split on : [3]*/"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:AssertionComment>
                                    <L7p:Comment stringValue="Connection refused"/>
                                    </L7p:CommentAssertion>
                                    <L7p:ComparisonAssertion>
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:Expression1 stringValue="${failure.messageText}"/>
                                    <L7p:MultivaluedComparison multivaluedComparison="ANY"/>
                                    <L7p:Operator operatorNull="null"/>
                                    <L7p:Predicates predicates="included">
                                    <L7p:item dataType="included">
                                    <L7p:Type variableDataType="string"/>
                                    </L7p:item>
                                    <L7p:item binary="included">
                                    <L7p:Operator operator="CONTAINS"/>
                                    <L7p:RightValue stringValue="Connection refused"/>
                                    </L7p:item>
                                    </L7p:Predicates>
                                    </L7p:ComparisonAssertion>
                                    <L7p:assertionComment>
                                    <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//Connection refused"/>
                                    </L7p:entry>
                                    </L7p:Properties>
                                    </L7p:assertionComment>
                                </wsp:All>
                                <L7p:TrueAssertion/>
                            </wsp:OneOrMore>
                            <L7p:assertionComment>
                                <L7p:Properties mapValue="included">
                                    <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//event 4042"/>
                                    </L7p:entry>
                                </L7p:Properties>
                            </L7p:assertionComment>
                        </wsp:All>
                    </wsp:OneOrMore>
                </wsp:All>
                <L7p:TrueAssertion/>
            </wsp:OneOrMore>
        </L7p:ForEachLoop>
        <L7p:CustomizeErrorResponse>
            <L7p:Content stringValueReference="inline"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>soapenv:Server</faultcode>
            <faultstring>${fault.string}</faultstring>
            <faultactor>${request.url}</faultactor>
            <detail>
                <datetime>${request.time}</datetime>
                <errorcode>${fault.code}${fault.status}${fault.char}</errorcode>
                <message>${fault.detail}</message>
        </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>]]></L7p:Content>
            <L7p:ContentType stringValue="text/xml;charset=utf-8"/>
            <L7p:ExtraHeaders nameValuePairArray="included"/>
            <L7p:HttpStatus stringValue="${fault.status}"/>
        </L7p:CustomizeErrorResponse>
        <L7p:ExportVariables>
            <L7p:AssertionComment assertionComment="included">
                <L7p:Properties mapValue="included">
                    <L7p:entry>
                        <L7p:key stringValue="RIGHT.COMMENT"/>
                        <L7p:value stringValue="//for use with alerting"/>
                    </L7p:entry>
                </L7p:Properties>
            </L7p:AssertionComment>
            <L7p:ExportedVars stringArrayValue="included">
                <L7p:item stringValue="failure.messageText"/>
            </L7p:ExportedVars>
        </L7p:ExportVariables>
        <wsp:All wsp:Usage="Required">
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="failure.messageText: error description for logging and optionally for notifications"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="fault.detail: english readable message for client"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="fault.string: short description for client"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="fault.code: custom event code meaningful only to Layer7 admin team"/>
            </L7p:CommentAssertion>
            <L7p:CommentAssertion>
                <L7p:Comment stringValue="fault.status: HTTP code to send to client"/>
            </L7p:CommentAssertion>
            <L7p:AuditDetailAssertion>
                <L7p:AssertionComment assertionComment="included">
                    <L7p:Properties mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="RIGHT.COMMENT"/>
                            <L7p:value stringValue="//audit"/>
                        </L7p:entry>
                    </L7p:Properties>
                </L7p:AssertionComment>
                <L7p:Detail stringValueReference="inline"><![CDATA[Routing latency: ${httpRouting.latency};
Route Falure: ${failure.messageText};
Route error ${fault.code} found; ${fault.status} sent]]></L7p:Detail>
            </L7p:AuditDetailAssertion>
            <L7p:assertionComment>
                <L7p:Properties mapValue="included">
                    <L7p:entry>
                        <L7p:key stringValue="RIGHT.COMMENT"/>
                        <L7p:value stringValue="//informational"/>
                    </L7p:entry>
                </L7p:Properties>
            </L7p:assertionComment>
        </wsp:All>
        <L7p:FalseAssertion>
            <L7p:AssertionComment assertionComment="included">
                <L7p:Properties mapValue="included">
                    <L7p:entry>
                        <L7p:key stringValue="RIGHT.COMMENT"/>
                        <L7p:value stringValue="//stop causes error response to be sent to client"/>
                    </L7p:entry>
                </L7p:Properties>
            </L7p:AssertionComment>
        </L7p:FalseAssertion>
    </wsp:All>
</wsp:Policy>