【问题标题】:Restore task class in WSO2 ESB在 WSO2 ESB 中恢复任务类
【发布时间】:2015-07-22 09:40:38
【问题描述】:

当我在 WSO2 ESB 中使用任务时,它总是对每个 Web 服务返回相同的错误:

“无法处理请求。无法识别操作'(mySoapAction)'”

其中 (mySoapAction) 是使用的每个 SOAP 操作,对于每个操作,对于我用于任务实现的每个代理服务。 我能做些什么来解决这个错误?我认为 org.apache.synapse.startup.tasks.MessageInjector 中存在任务类错误。 显然任务实现是正确的,因为前一天的相同任务运行良好。有什么建议吗?

【问题讨论】:

    标签: class soap proxy wso2 wso2esb


    【解决方案1】:

    这里有一个带有天气网络服务的示例 (http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL)

    代理服务:

    <?xml version="1.0" encoding="UTF-8"?>
    <proxy xmlns="http://ws.apache.org/ns/synapse"
           name="TestSOF"
           transports="https http"
           startOnLoad="true"
           trace="disable">
       <target>
          <endpoint>
             <wsdl service="Weather"
                   port="WeatherSoap12"
                   uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL"/>
          </endpoint>
          <outSequence>
              <log level="full"/>
              <property name="OUT_ONLY" value="true"/>
              <property name="transport.vfs.ReplyFileName" value="weather.xml" scope="transport"/>
              <send>
                <endpoint>
                    <address uri="vfs:file:///E:/temp"/>
                </endpoint>
              </send>
          </outSequence>
       </target>
       <publishWSDL uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL"/>
    </proxy>
    

    任务:

    <?xml version="1.0" encoding="UTF-8"?>
    <task xmlns="http://ws.apache.org/ns/synapse"
          name="TestSOFTask"
          class="org.apache.synapse.startup.tasks.MessageInjector"
          group="synapse.simple.quartz">
       <trigger count="1" interval="1"/>
       <property xmlns:task="http://www.wso2.org/products/wso2commons/tasks"
                 name="proxyName"
                 value="TestSOF"/>
       <property xmlns:task="http://www.wso2.org/products/wso2commons/tasks"
                 name="soapAction"
                 value="http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP"/>
       <property xmlns:task="http://www.wso2.org/products/wso2commons/tasks" name="message">
          <weat:GetCityWeatherByZIP xmlns:weat="http://ws.cdyne.com/WeatherWS/">
             <weat:ZIP>11010</weat:ZIP>
          </weat:GetCityWeatherByZIP>
       </property>
       <property xmlns:task="http://www.wso2.org/products/wso2commons/tasks"
                 name="format"
                 value="soap12"/>
       <property xmlns:task="http://www.wso2.org/products/wso2commons/tasks"
                 name="injectTo"
                 value="proxy"/>
    </task>
    

    调度任务,你会在文件名weather.xml中找到服务响应

    如果你想从soap12更改为soap11:

    • 将任务 def 中属性“format”的值更改为:soap11
    • 使用端口“WeatherSoap”而不是“WeatherSoap12”更改代理服务中的端点定义

    希望它能帮助您找出您的配置出了什么问题...

    【讨论】:

    • 谢谢,真的很有用。我的问题是“soapAction”字段,我在您的示例中看到,我必须最后输入所有带有soapAction 名称的命名空间,并格式化没有 标记的soap 消息。然而这很奇怪,因为几天前它在实现上没有这些差异。非常感谢。
    猜你喜欢
    • 2016-05-19
    • 2016-06-14
    • 1970-01-01
    • 2012-08-31
    • 1970-01-01
    • 2014-01-06
    • 2023-04-04
    • 2012-08-08
    • 1970-01-01
    相关资源
    最近更新 更多