WSO2 ESB Twitter 连接器不调用 Twitter API



我在代理服务中使用WSO2 ESB Twitter连接器操作。代理配置如下

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="twitter_test_proxy" transports="http https" startOnLoad="true" trace="disable">
    <target>
        <inSequence>
            <twitter.init configKey="twitter_init"/>
            <twitter.getTopTrendPlaces configKey="twitter_init">
                <id>23424975</id>
            </twitter.getTopTrendPlaces>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </target>
</proxy>

我将推特连接器导入 esb 并启用它。然后,所有工件(代理服务和twitter_init本地条目)都部署在 ESB 中。一旦我调用代理服务,注意到推特连接器没有调用预期的后端推特API。我已经启用了电线调试和调试日志,如下所示。这是什么原因呢?我正在使用 WSO2 ESB 4.8.1。我按照此处给出的说明创建配置

[2014-11-12 20:07:47,785] DEBUG - header >> "POST /services/twitter_test_proxy.twitter_test_proxyHttpSoap12Endpoint HTTP/1.1[r][n]"
[2014-11-12 20:07:47,793] DEBUG - header >> "Content-Type: application/soap+xml; charset=UTF-8; action="urn:mediate"[r][n]"
[2014-11-12 20:07:47,793] DEBUG - header >> "Cookie: menuPanel=visible; menuPanelType=main; wso2.carbon.rememberme=admin-60c7726f-6e4b-462c-88c2-13753ab95974; JSESSIONID=6297A74817478FFE0F4B6EB392022E29; requestedURI="../../carbon/service-mgt/index.jsp?region=region1&item=services_list_menu"; region1_configure_menu=none; region3_registry_menu=none; region4_monitor_menu=none; region5_tools_menu=none; MSG14156327996440.7180992366157122=true; MSG14156330072650.6915075827877599=true; current-breadcrumb=manage_menu%2Cservices_menu%2Cservices_list_menu%23proxyservices+index.jsp*+index.jsp*; MSG14157205387400.9361328898335365=true; MSG14157205491900.33127844546453067=true; MSG14157205807580.7846254111223301=true; MSG14157216353420.11143615454004241=true[r][n]"
[2014-11-12 20:07:47,793] DEBUG - header >> "User-Agent: Axis2[r][n]"
[2014-11-12 20:07:47,793] DEBUG - header >> "Host: asanka-virtual-machine:8280[r][n]"
[2014-11-12 20:07:47,794] DEBUG - header >> "Transfer-Encoding: chunked[r][n]"
[2014-11-12 20:07:47,794] DEBUG - header >> "[r][n]"
[2014-11-12 20:07:47,794] DEBUG - content >> "a0[r][n]"
[2014-11-12 20:07:47,794] DEBUG - content >> "<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body></soapenv:Body></soapenv:Envelope>"
[2014-11-12 20:07:47,795] DEBUG - content >> "[r][n]"
[2014-11-12 20:07:47,796] DEBUG - content >> "0"
[2014-11-12 20:07:47,796] DEBUG - content >> "[r][n]"
[2014-11-12 20:07:47,797] DEBUG - content >> "[r][n]"

我可以通过对代理进行轻微修改来解决上述问题。我添加了响应调解员并得到了预期的结果。工作代理如下所述。

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="twitter-connector-proxy" transports="http https" startOnLoad="true" trace="disable">
    <target>
        <inSequence>
            <log level="full">
                <property name="INIT" value="##### Call to the Proxy #####"/>
            </log>
            <twitter.init/>
            <twitter.search configKey="twitter_init">
                <search>cricket</search>
            </twitter.search>
            <log level="full">
                <property name="RESULT" value="#### Twitter Search Result ####"/>
            </log>
            <respond/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </target>
</proxy>

最新更新