Thursday, April 24, 2014

Fragment Include Lookup Service

This service was written for version 8.0 of the Layer 7 Gateway, there was a schema change in the database from version 6.2 which will prevent it from working, and it has not been tested on version 7.x.

In order to use this service you must first setup a connection to your layer 7 database.  Then create an API and paste the below policy definition into it.  Lastly update these assertions; 10: Authenticate against internal identity provider, make sure that it is pointed to your provider as the internal object ID might not match from my environment to yours; 38: Perform JDBC Query, point it to your database connection; 63: Perform JDBC Query, point it to your database connection.  Now you can call this service, initially it will list out your fragments; then when you pass it the parameter described on the html page returned by the service it will list out the services that call the fragment you specify.

Note: It instructs you to pass the fragment name and then does a wildcard search on it, if the results are not as expected then you can use the service to search by objectid parameter from the hex column value instead of the name.

<?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:OneOrMore wsp:Usage="Required">
            <L7p:SslAssertion/>
            <wsp:All wsp:Usage="Required">
                <L7p:CustomizeErrorResponse>
                    <L7p:ErrorLevel errorLevel="DROP_CONNECTION"/>
                    <L7p:ExtraHeaders nameValuePairArray="included"/>
                </L7p:CustomizeErrorResponse>
                <L7p:FalseAssertion/>
            </wsp:All>
            <L7p:assertionComment>
                <L7p:Properties mapValue="included">
                    <L7p:entry>
                        <L7p:key stringValue="RIGHT.COMMENT"/>
                        <L7p:value stringValue="// require secure communications"/>
                    </L7p:entry>
                </L7p:Properties>
            </L7p:assertionComment>
        </wsp:OneOrMore>
        <wsp:OneOrMore wsp:Usage="Required">
            <wsp:All wsp:Usage="Required">
                <L7p:HttpBasic/>
                <L7p:Authentication>
                    <L7p:IdentityProviderOid goidValue="0000000000000000fffffffffffffffe"/>
                </L7p:Authentication>
            </wsp:All>
            <wsp:All wsp:Usage="Required">
                <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:Client</faultcode>
            <faultstring>Access Denied</faultstring>
            <faultactor>${request.url}</faultactor>
            <detail>
                <datetime>${request.time}</datetime>
                <errorcode>403: Forbidden</errorcode>
                <message>The credentials you have provided are not permitted to access this service.</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="403"/>
                </L7p:CustomizeErrorResponse>
                <L7p:FalseAssertion/>
            </wsp:All>
            <L7p:assertionComment>
                <L7p:Properties mapValue="included">
                    <L7p:entry>
                        <L7p:key stringValue="RIGHT.COMMENT"/>
                        <L7p:value stringValue="// require http admin credentials"/>
                    </L7p:entry>
                </L7p:Properties>
            </L7p:assertionComment>
        </wsp:OneOrMore>
        <wsp:OneOrMore wsp:Usage="Required">
            <L7p:RateLimit>
                <L7p:BlackoutPeriodInSeconds stringValue="10"/>
                <L7p:CounterName stringValue="${request.tcp.localIP}-${service.policy.guid}-${request.tcp.localPort}-${request.ssl.clientCertificate.subject}-${request.username}"/>
                <L7p:MaxConcurrency stringValue="3"/>
                <L7p:MaxRequestsPerSecond stringValue="10"/>
                <L7p:SplitConcurrencyLimitAcrossNodes booleanValue="false"/>
                <L7p:SplitRateLimitAcrossNodes booleanValue="false"/>
                <L7p:WindowSizeInSeconds stringValue="10"/>
            </L7p:RateLimit>
            <wsp:All wsp:Usage="Required">
                <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:Client</faultcode>
            <faultstring>Too Many Requests</faultstring>
            <faultactor>${request.url}</faultactor>
            <detail>
                <datetime>${request.time}</datetime>
                <errorcode>429: Too Many Requests</errorcode>
                <message>Your requests to this service have exceeded the premitted rate limit, please wait a few seconds and try your request again.</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="429"/>
                </L7p:CustomizeErrorResponse>
                <L7p:FalseAssertion/>
            </wsp:All>
            <L7p:assertionComment>
                <L7p:Properties mapValue="included">
                    <L7p:entry>
                        <L7p:key stringValue="RIGHT.COMMENT"/>
                        <L7p:value stringValue="// rate limit dos\sniffing protection"/>
                    </L7p:entry>
                </L7p:Properties>
            </L7p:assertionComment>
        </wsp:OneOrMore>
        <wsp:OneOrMore wsp:Usage="Required">
            <wsp:All wsp:Usage="Required">
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="JHtyZXF1ZXN0Lmh0dHAucGFyYW1ldGVyLmZyYWdtZW50fQ=="/>
                    <L7p:ContentType stringValue="text/xml; charset=utf-8"/>
                    <L7p:DataType variableDataType="message"/>
                    <L7p:VariableToSet stringValue="fragment"/>
                </L7p:SetVariable>
                <L7p:Regex>
                    <L7p:AutoTarget booleanValue="false"/>
                    <L7p:FindAll booleanValue="true"/>
                    <L7p:OtherTargetMessageVariable stringValue="fragment"/>
                    <L7p:Regex stringValue="\A[a-zA-Z0-9]*\Z"/>
                    <L7p:RegexName stringValue="injection test"/>
                    <L7p:Replacement stringValue=""/>
                    <L7p:Target target="OTHER"/>
                </L7p:Regex>
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="JSR7cmVxdWVzdC5odHRwLnBhcmFtZXRlci5mcmFnbWVudH0l"/>
                    <L7p:VariableToSet stringValue="fragment"/>
                </L7p:SetVariable>
            </wsp:All>
            <L7p:SetVariable>
                <L7p:Base64Expression stringValue="JQ=="/>
                <L7p:VariableToSet stringValue="fragment"/>
            </L7p:SetVariable>
            <L7p:assertionComment>
                <L7p:Properties mapValue="included">
                    <L7p:entry>
                        <L7p:key stringValue="RIGHT.COMMENT"/>
                        <L7p:value stringValue="// code\sql injection detection"/>
                    </L7p:entry>
                </L7p:Properties>
            </L7p:assertionComment>
        </wsp:OneOrMore>
        <wsp:OneOrMore wsp:Usage="Required">
            <wsp:All wsp:Usage="Required">
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="JHtyZXF1ZXN0Lmh0dHAucGFyYW1ldGVyLm9iamVjdGlkfQ=="/>
                    <L7p:ContentType stringValue="text/xml; charset=utf-8"/>
                    <L7p:DataType variableDataType="message"/>
                    <L7p:VariableToSet stringValue="objectid"/>
                </L7p:SetVariable>
                <L7p:Regex>
                    <L7p:AutoTarget booleanValue="false"/>
                    <L7p:FindAll booleanValue="true"/>
                    <L7p:OtherTargetMessageVariable stringValue="objectid"/>
                    <L7p:Regex stringValue="\A[a-fA-F0-9]*\Z"/>
                    <L7p:RegexName stringValue="injection test"/>
                    <L7p:Replacement stringValue=""/>
                    <L7p:Target target="OTHER"/>
                </L7p:Regex>
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="JSR7cmVxdWVzdC5odHRwLnBhcmFtZXRlci5vYmplY3RpZH0l"/>
                    <L7p:VariableToSet stringValue="objectid"/>
                </L7p:SetVariable>
            </wsp:All>
            <L7p:SetVariable>
                <L7p:Base64Expression stringValue="JQ=="/>
                <L7p:VariableToSet stringValue="objectid"/>
            </L7p:SetVariable>
            <L7p:assertionComment>
                <L7p:Properties mapValue="included">
                    <L7p:entry>
                        <L7p:key stringValue="RIGHT.COMMENT"/>
                        <L7p:value stringValue="// code\sql injection detection"/>
                    </L7p:entry>
                </L7p:Properties>
            </L7p:assertionComment>
        </wsp:OneOrMore>
        <wsp:OneOrMore wsp:Usage="Required">
            <wsp:All wsp:Usage="Required">
                <wsp:OneOrMore wsp:Usage="Required">
                    <L7p:ComparisonAssertion>
                        <L7p:CaseSensitive booleanValue="false"/>
                        <L7p:Expression1 stringValue="${fragment}"/>
                        <L7p:MultivaluedComparison multivaluedComparison="FAIL"/>
                        <L7p:Operator operatorNull="null"/>
                        <L7p:Predicates predicates="included">
                            <L7p:item dataType="included">
                                <L7p:Type variableDataType="string"/>
                            </L7p:item>
                            <L7p:item binary="included">
                                <L7p:CaseSensitive booleanValue="false"/>
                                <L7p:Negated booleanValue="true"/>
                                <L7p:RightValue stringValue="%"/>
                            </L7p:item>
                        </L7p:Predicates>
                    </L7p:ComparisonAssertion>
                    <L7p:ComparisonAssertion>
                        <L7p:CaseSensitive booleanValue="false"/>
                        <L7p:Expression1 stringValue="${objectid}"/>
                        <L7p:MultivaluedComparison multivaluedComparison="FAIL"/>
                        <L7p:Operator operatorNull="null"/>
                        <L7p:Predicates predicates="included">
                            <L7p:item dataType="included">
                                <L7p:Type variableDataType="string"/>
                            </L7p:item>
                            <L7p:item binary="included">
                                <L7p:CaseSensitive booleanValue="false"/>
                                <L7p:Negated booleanValue="true"/>
                                <L7p:RightValue stringValue="%"/>
                            </L7p:item>
                        </L7p:Predicates>
                    </L7p:ComparisonAssertion>
                </wsp:OneOrMore>
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="PGh0bWw+PGJvZHk+PHRhYmxlIGJvcmRlcj4NCjx0ciBhbGlnbj1jZW50ZXIgdmFsaWduPW1pZGRsZT48dGQ+T2JqZWN0aWQ8L3RkPjx0ZD5TZXJ2aWNlPC90ZD48dGQ+Um91dGluZyBVUkk8L3RkPjwvdHI+"/>
                    <L7p:VariableToSet stringValue="csv"/>
                </L7p:SetVariable>
                <L7p:AuditDetailAssertion>
                    <L7p:Detail stringValueReference="inline"><![CDATA[SELECT hex(s.goid) as objectid, s.name, s.routing_uri, s.disabled,
       case when v.xml regexp concat('<L7p:Enabled booleanValue="false"/>\n[ ]*<L7p:PolicyGuid stringValue="',
                        (SELECT guid
                         FROM ssg.policy
                         WHERE policy_type = 'include_fragment'
                           AND name like '${fragment}'
                           AND hex(goid) like '${objectid}'),
         '"/>')
            then 1
            else 0
       end as commented
FROM ssg.published_service s inner join
     ssg.policy_version v on (s.policy_goid = v.policy_goid)
WHERE v.active = 1
  AND v.xml like concat('%<L7p:PolicyGuid stringValue="',
                        (SELECT guid
                         FROM ssg.policy
                         WHERE policy_type = 'include_fragment'
                           AND name like '${fragment}'
                           AND hex(goid) like '${objectid}'),
         '"/>%')
ORDER BY s.name, s.routing_uri, s.goid;]]></L7p:Detail>
                </L7p:AuditDetailAssertion>
                <L7p:JdbcQuery>
                    <L7p:AssertionFailureEnabled booleanValue="false"/>
                    <L7p:ConnectionName stringValue="SSG"/>
                    <L7p:MaxRecords intValue="1000"/>
                    <L7p:NamingMap mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="commented"/>
                            <L7p:value stringValue="commented"/>
                        </L7p:entry>
                        <L7p:entry>
                            <L7p:key stringValue="disabled"/>
                            <L7p:value stringValue="disabled"/>
                        </L7p:entry>
                        <L7p:entry>
                            <L7p:key stringValue="name"/>
                            <L7p:value stringValue="name"/>
                        </L7p:entry>
                        <L7p:entry>
                            <L7p:key stringValue="objectid"/>
                            <L7p:value stringValue="objectid"/>
                        </L7p:entry>
                        <L7p:entry>
                            <L7p:key stringValue="routing_uri"/>
                            <L7p:value stringValue="routing_uri"/>
                        </L7p:entry>
                    </L7p:NamingMap>
                    <L7p:SqlQuery stringValueReference="inline"><![CDATA[SELECT hex(s.goid) as objectid, s.name, s.routing_uri, s.disabled,
       case when v.xml not regexp concat('<L7p:Enabled booleanValue="false"/>\n[ ]*<L7p:PolicyGuid stringValue="',
                        (SELECT guid
                         FROM ssg.policy
                         WHERE policy_type = 'include_fragment'
                           AND name like ${fragment}
                           AND hex(goid) like ${objectid}),
         '"/>')
            then 0
            else 1
       end as commented
FROM ssg.published_service s inner join
     ssg.policy_version v on (s.policy_goid = v.policy_goid)
WHERE v.active = 1
  AND v.xml like concat('%<L7p:PolicyGuid stringValue="',
                        (SELECT guid
                         FROM ssg.policy
                         WHERE policy_type = 'include_fragment'
                           AND name like ${fragment}
                           AND hex(goid) like ${objectid}),
         '"/>%')
ORDER BY s.name, s.routing_uri, s.goid;]]></L7p:SqlQuery>
                    <L7p:VariablePrefix stringValue="references"/>
                </L7p:JdbcQuery>
                <L7p:ForEachLoop L7p:Usage="Required"
                    loopVariable="references.objectid" variablePrefix="service">
                    <wsp:All wsp:Usage="Required">
                        <L7p:ItemLookupByIndex>
                            <L7p:IndexValue stringValue="${service.iterations}"/>
                            <L7p:MultivaluedVariableName stringValue="references.objectid"/>
                            <L7p:OutputVariableName stringValue="objectid"/>
                        </L7p:ItemLookupByIndex>
                        <L7p:ItemLookupByIndex>
                            <L7p:IndexValue stringValue="${service.iterations}"/>
                            <L7p:MultivaluedVariableName stringValue="references.name"/>
                            <L7p:OutputVariableName stringValue="name"/>
                        </L7p:ItemLookupByIndex>
                        <L7p:ItemLookupByIndex>
                            <L7p:IndexValue stringValue="${service.iterations}"/>
                            <L7p:MultivaluedVariableName stringValue="references.routing_uri"/>
                            <L7p:OutputVariableName stringValue="routing_uri"/>
                        </L7p:ItemLookupByIndex>
                        <L7p:ItemLookupByIndex>
                            <L7p:IndexValue stringValue="${service.iterations}"/>
                            <L7p:MultivaluedVariableName stringValue="references.disabled"/>
                            <L7p:OutputVariableName stringValue="disabled"/>
                        </L7p:ItemLookupByIndex>
                        <L7p:ItemLookupByIndex>
                            <L7p:IndexValue stringValue="${service.iterations}"/>
                            <L7p:MultivaluedVariableName stringValue="references.commented"/>
                            <L7p:OutputVariableName stringValue="commented"/>
                        </L7p:ItemLookupByIndex>
                        <L7p:assertionComment>
                            <L7p:Properties mapValue="included">
                                <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//map policy properties"/>
                                </L7p:entry>
                            </L7p:Properties>
                        </L7p:assertionComment>
                    </wsp:All>
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="PHRy"/>
                        <L7p:VariableToSet stringValue="service"/>
                    </L7p:SetVariable>
                    <wsp:OneOrMore wsp:Usage="Required">
                        <L7p:ComparisonAssertion>
                            <L7p:CaseSensitive booleanValue="false"/>
                            <L7p:Expression1 stringValue="${disabled}"/>
                            <L7p:Expression2 stringValue="0"/>
                            <L7p:Predicates predicates="included">
                                <L7p:item binary="included">
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:RightValue stringValue="0"/>
                                </L7p:item>
                            </L7p:Predicates>
                        </L7p:ComparisonAssertion>
                        <L7p:SetVariable>
                            <L7p:Base64Expression stringValue="JHtzZXJ2aWNlfSBiZ2NvbG9yPSJBQUFBQUEi"/>
                            <L7p:VariableToSet stringValue="service"/>
                        </L7p:SetVariable>
                        <L7p:assertionComment>
                            <L7p:Properties mapValue="included">
                                <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//gray out disabled services"/>
                                </L7p:entry>
                            </L7p:Properties>
                        </L7p:assertionComment>
                    </wsp:OneOrMore>
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="JHtzZXJ2aWNlfT48dGQgbm93cmFwPiR7b2JqZWN0aWR9PC90ZD48dGQgbm93cmFwPg=="/>
                        <L7p:VariableToSet stringValue="service"/>
                    </L7p:SetVariable>
                    <wsp:OneOrMore wsp:Usage="Required">
                        <wsp:All wsp:Usage="Required">
                            <L7p:ComparisonAssertion>
                                <L7p:CaseSensitive booleanValue="false"/>
                                <L7p:Expression1 stringValue="${commented}"/>
                                <L7p:Expression2 stringValue="0"/>
                                <L7p:Predicates predicates="included">
                                    <L7p:item binary="included">
                                    <L7p:CaseSensitive booleanValue="false"/>
                                    <L7p:RightValue stringValue="0"/>
                                    </L7p:item>
                                </L7p:Predicates>
                            </L7p:ComparisonAssertion>
                            <L7p:SetVariable>
                                <L7p:Base64Expression stringValue="JHtzZXJ2aWNlfSR7bmFtZX0="/>
                                <L7p:VariableToSet stringValue="service"/>
                            </L7p:SetVariable>
                        </wsp:All>
                        <L7p:SetVariable>
                            <L7p:Base64Expression stringValue="JHtzZXJ2aWNlfTxmb250IGNvbG9yPSJDQzExMDAiPiR7bmFtZX08L2ZvbnQ+"/>
                            <L7p:VariableToSet stringValue="service"/>
                        </L7p:SetVariable>
                        <L7p:assertionComment>
                            <L7p:Properties mapValue="included">
                                <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//red text disabled assertions"/>
                                </L7p:entry>
                            </L7p:Properties>
                        </L7p:assertionComment>
                    </wsp:OneOrMore>
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="JHtzZXJ2aWNlfTwvdGQ+PHRkIG5vd3JhcD4ke3JvdXRpbmdfdXJpfTwvdGQ+PC90ZD48L3RyPg=="/>
                        <L7p:VariableToSet stringValue="service"/>
                    </L7p:SetVariable>
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="JHtjc3Z9DQoke3NlcnZpY2V9"/>
                        <L7p:VariableToSet stringValue="csv"/>
                    </L7p:SetVariable>
                </L7p:ForEachLoop>
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="JHtjc3Z9DQo8L3RhYmxlPg0KUm93cyBpbiBncmF5IGFyZSBkaXNhYmxlZCBzZXJ2aWNlcy4NCk5hbWVzIGluIHJlZCBhcmUgc2VydmljZXMgaW4gd2hpY2ggdGhlIHJlZmVyZW5jZWQgZnJhZ21lbnQgaW5jbHVkZSBhc3NlcnRpb24gaXMgZGlzYWJsZWQuPC9ib2R5PjwvaHRtbD4="/>
                    <L7p:VariableToSet stringValue="csv"/>
                </L7p:SetVariable>
                <L7p:assertionComment>
                    <L7p:Properties mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="RIGHT.COMMENT"/>
                            <L7p:value stringValue="// list services that contain requested fragment"/>
                        </L7p:entry>
                    </L7p:Properties>
                </L7p:assertionComment>
            </wsp:All>
            <wsp:All wsp:Usage="Required">
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="PGh0bWw+PGJvZHk+PHRhYmxlIGJvcmRlcj4NCjx0ciBhbGlnbj1jZW50ZXIgdmFsaWduPW1pZGRsZT48dGQ+T2JqZWN0aWQ8L3RkPjx0ZD5TZXJ2aWNlPC90ZD48L3RyPg=="/>
                    <L7p:VariableToSet stringValue="csv"/>
                </L7p:SetVariable>
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="VG8gZ2V0IGEgbGlzdGluZyBvZiBzZXJ2aWNlcyByZWZlcmVuY2VpbmcgYSBnaXZlbiBmcmFnbWVudCBjYWxsIHRoaXMgc2VydmljZSB3aXRoIHRoZSBwYXJhbWV0ZXIgP2ZyYWdtZW50PVtuYW1lXSB3aGVyZSBbbmFtZV0gaXMgdGhlIGZyYWdtZW50IHRoYXQgeW91IHdhbnQgdGhlIGxpc3Qgb2Ygc2VydmljZXMgdGhhdCBhcmUgbWFraW5nIHVzZSBvZiB0aGF0IGZyYWdtZW50Lg0KIA0KJHtjc3Z9"/>
                    <L7p:VariableToSet stringValue="csv"/>
                </L7p:SetVariable>
                <L7p:AuditDetailAssertion>
                    <L7p:Detail stringValueReference="inline"><![CDATA[SELECT hex(goid) as objectid, name
FROM ssg.policy
WHERE policy_type = 'include_fragment'
ORDER BY name, goid;]]></L7p:Detail>
                </L7p:AuditDetailAssertion>
                <L7p:JdbcQuery>
                    <L7p:AssertionFailureEnabled booleanValue="false"/>
                    <L7p:ConnectionName stringValue="SSG"/>
                    <L7p:MaxRecords intValue="1000"/>
                    <L7p:NamingMap mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="name"/>
                            <L7p:value stringValue="name"/>
                        </L7p:entry>
                        <L7p:entry>
                            <L7p:key stringValue="objectid"/>
                            <L7p:value stringValue="objectid"/>
                        </L7p:entry>
                    </L7p:NamingMap>
                    <L7p:SqlQuery stringValueReference="inline"><![CDATA[SELECT hex(goid) as objectid, name
FROM ssg.policy
WHERE policy_type = 'include_fragment'
ORDER BY name, goid;]]></L7p:SqlQuery>
                    <L7p:VariablePrefix stringValue="fragments"/>
                </L7p:JdbcQuery>
                <L7p:ForEachLoop L7p:Usage="Required"
                    loopVariable="fragments.objectid" variablePrefix="service">
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="PHRyPg=="/>
                        <L7p:VariableToSet stringValue="service"/>
                    </L7p:SetVariable>
                    <wsp:All wsp:Usage="Required">
                        <L7p:ItemLookupByIndex>
                            <L7p:IndexValue stringValue="${service.iterations}"/>
                            <L7p:MultivaluedVariableName stringValue="fragments.objectid"/>
                            <L7p:OutputVariableName stringValue="objectid"/>
                        </L7p:ItemLookupByIndex>
                        <L7p:ItemLookupByIndex>
                            <L7p:IndexValue stringValue="${service.iterations}"/>
                            <L7p:MultivaluedVariableName stringValue="fragments.name"/>
                            <L7p:OutputVariableName stringValue="name"/>
                        </L7p:ItemLookupByIndex>
                        <L7p:SetVariable>
                            <L7p:Base64Expression stringValue="JHtzZXJ2aWNlfTx0ZCBub3dyYXA+JHtvYmplY3RpZH08L3RkPjx0ZCBub3dyYXA+JHtuYW1lfTwvdGQ+PC90ZD4="/>
                            <L7p:VariableToSet stringValue="service"/>
                        </L7p:SetVariable>
                        <L7p:assertionComment>
                            <L7p:Properties mapValue="included">
                                <L7p:entry>
                                    <L7p:key stringValue="RIGHT.COMMENT"/>
                                    <L7p:value stringValue="//map policy properties"/>
                                </L7p:entry>
                            </L7p:Properties>
                        </L7p:assertionComment>
                    </wsp:All>
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="JHtzZXJ2aWNlfTwvdHI+"/>
                        <L7p:VariableToSet stringValue="service"/>
                    </L7p:SetVariable>
                    <L7p:SetVariable>
                        <L7p:Base64Expression stringValue="JHtjc3Z9DQoke3NlcnZpY2V9"/>
                        <L7p:VariableToSet stringValue="csv"/>
                    </L7p:SetVariable>
                </L7p:ForEachLoop>
                <L7p:SetVariable>
                    <L7p:Base64Expression stringValue="JHtjc3Z9DQo8L3RhYmxlPjwvYm9keT48L2h0bWw+"/>
                    <L7p:VariableToSet stringValue="csv"/>
                </L7p:SetVariable>
                <L7p:assertionComment>
                    <L7p:Properties mapValue="included">
                        <L7p:entry>
                            <L7p:key stringValue="RIGHT.COMMENT"/>
                            <L7p:value stringValue="// list fragments"/>
                        </L7p:entry>
                    </L7p:Properties>
                </L7p:assertionComment>
            </wsp:All>
            <L7p:assertionComment>
                <L7p:Properties mapValue="included">
                    <L7p:entry>
                        <L7p:key stringValue="RIGHT.COMMENT"/>
                        <L7p:value stringValue="// build table of services or fragments"/>
                    </L7p:entry>
                </L7p:Properties>
            </L7p:assertionComment>
        </wsp:OneOrMore>
        <L7p:HardcodedResponse>
            <L7p:Base64ResponseBody stringValue="JHtjc3Z9"/>
            <L7p:ResponseContentType stringValue="text/html; charset=utf-8"/>
        </L7p:HardcodedResponse>
    </wsp:All>
</wsp:Policy>