简体   繁体   中英

Restore task class in WSO2 ESB

When i use a task in WSO2 ESB it always returns the same error with every web service:

"Unable to handle request. The action '(mySoapAction)' was not recognized"

where (mySoapAction) is every SOAP action used, for EVERY action, for EVERY proxy service i use for task implementation. What could i do in order to fix this error? I thought a task class error in org.apache.synapse.startup.tasks.MessageInjector. Obvoiusly the task implementation is correct, because the same tasks some day ago were perfectly working. Suggestions?

Here come a sample with the weather webservice ( http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL )

Proxy service :

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

Task :

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

Schedule the task and you will find the service response in a file name weather.xml

If you want to change from soap12 to soap11 :

  • Change the value of property "format" in the task def to : soap11
  • Change the endpoint def in the proxy service using port " WeatherSoap " rather than "WeatherSoap12"

Hope it will help you to find what is going wrong with your conf...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM