WSO2 - как передать два параметра одновременно с помощью конфигурации WSO2 ESB - PullRequest
0 голосов
/ 27 ноября 2018

Я создал API в диспетчере API.Я могу вызвать его с помощью

http://localhost:6547/generatereports/1.0/Reports/dcuid/vcid

Я передаю два параметра одновременно с помощью "dcuid и vcid", но не передаю.

reportsapi:

<?xml version="1.0" encoding="UTF-8"?>
<api context="generatereports/1.0/Reports" name="reportsdataapi" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET" protocol="http" uri-template="/{dcuid}/{vcid}">
        <inSequence>
            <property description="http" name="HTTP_SC" scope="axis2" type="STRING" value="404"/>
            <log level="full"/>
            <send>
                <endpoint key="reportsendpoint"/>
            </send>
        </inSequence>
        <outSequence>
            <switch source="get-property('axis2','HTTP_SC')">
                <case regex="200">
                    <log description="200log" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="200reserrorcode"/>
                    </log>
                    <send/>
                </case>
                <default>
                    <log description="reslog" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="reserrorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="reserrormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="reshttpsc"/>
                    </log>
                </default>
            </switch>

            <send/>
        </outSequence>
        <faultSequence>
            <switch source="get-property('axis2','HTTP_SC')">
                <case regex="200">
                    <log description="200log" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="200reserrorcode"/>
                    </log>
                </case>
                <default>
                    <log description="reslog" level="custom">
                        <property expression="$ctx:ERROR_CODE" name="reserrorcode"/>
                        <property expression="$ctx:ERROR_MESSAGE" name="reserrormessage"/>
                        <property expression="get-property('axis2','HTTP_SC')" name="reshttpsc"/>
                    </log>
                </default>
            </switch>

            <send/>
        </faultSequence>
    </resource>
</api>

wso2Процесс конфигурации с отправкой ответа отличается от 200. Код отчета: точка отправки:

    <?xml version="1.0" encoding="UTF-8"?>
<endpoint name="reporsendpoint" xmlns="http://ws.apache.org/ns/synapse">
    <http method="get" uri-template="http://localhost:6547/generatereports/1.0/Reports/{uri.var.dcuid}/{uri.var.vcid}"/>
</endpoint>

1 Ответ

0 голосов
/ 09 мая 2019

Я предполагаю, что вы хотите отправить письмо, если код состояния отличается от 200. Тогда вы можете использовать mailto transport или почтовые соединители, такие как gmail connector Outlook Outnector и добавьте конфигурацию в разделе по умолчанию в сконфигурированном посреднике коммутатора.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...