【问题标题】:wso2 esb twitter connector not invoking the twitter apiwso2 esb twitter 连接器不调用 twitter api
【发布时间】:2014-11-18 20:36:13
【问题描述】:

我在代理服务中使用 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>

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

[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]"

【问题讨论】:

    标签: wso2 wso2esb


    【解决方案1】:

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

    <?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>
    

    【讨论】:

      猜你喜欢
      • 2016-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多