简体   繁体   中英

WSO2 ESB | VFS to Service Mediation

I want to read a set of files from FTP server and then pass it to my service for transformation and then sent the transformed file to be written to the output folder via VFS. I configured the VFS protocol and also configured the endpoint. Please see below the configurations:

<?xml version="1.0" encoding="UTF-8"?>
    <proxy xmlns="http://ws.apache.org/ns/synapse"
           name="FileSystemVFSProxy"
           transports="https,http,local,vfs"
           statistics="disable"
           trace="disable"
           startOnLoad="true">
       <target>
          <inSequence>
             <log level="full"/>
             <send>
                <endpoint>
                   <address uri="http://localhost:8280/services/EDIMessenger" format="soap11"/>
                </endpoint>
             </send>
          </inSequence>
          <outSequence>
             <property name="transport.vfs.ReplyFileName"
                       value="test.xml"
                       scope="transport"
                       type="STRING"/>
             <property name="OUT_ONLY" value="true"/>
             <send>
                <endpoint>
                   <address uri="vfs:file:///D:/WSO2"/>
                </endpoint>
             </send>
          </outSequence>
       </target>
       <parameter name="transport.PollInterval">15</parameter>
       <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
       <parameter name="transport.vfs.FileURI">file:///D:/WSO2/content</parameter>
       <parameter name="transport.vfs.MoveAfterProcess">file:///D:/WSO2/original</parameter>
       <parameter name="transport.vfs.MoveAfterFailure">file:///D:/WSO2/Archive</parameter>
       <parameter name="transport.vfs.FileNamePattern">.*\.*</parameter>
       <parameter name="transport.vfs.ContentType">text/plain</parameter>
       <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
       <description/>
    </proxy>

The service configuration is as below:

<?xml version="1.0" encoding="UTF-8"?>
<serviceGroup name="EDIMessengerEx_1.0.0"
              hashValue="74dc0f1e0e5cef0a5d78d09dc7f0edb1"
              successfullyAdded="true">
   <service name="EDIMessenger"
            serviceDocumentation="EDIMessenger"
            exposedAllTransports="true"
            serviceDeployedTime="1403437845501"
            successfullyAdded="true">
      <operation name="method1">
         <module name="addressing" version="4.2.0" type="engagedModules"/>
      </operation>
      <bindings>
         <binding name="EDIMessengerSoap11Binding">
            <operation name="method1"/>
         </binding>
         <binding name="EDIMessengerSoap12Binding">
            <operation name="method1"/>
         </binding>
         <binding name="EDIMessengerHttpBinding">
            <operation name="method1"/>
         </binding>
      </bindings>
      <policies/>
      <module name="addressing" version="4.2.0" type="engagedModules"/>
      <parameter name="ServiceClass" locked="false">com.xxx.EDIMessenger</parameter>
      <parameter name="transport.vfs.FileURI" locked="false" type="1">file:///D:/WSO2/content</parameter>
      <parameter name="transport.vfs.FileNamePattern" locked="false" type="1">.*\.*</parameter>
      <parameter name="transport.vfs.ContentType" locked="false" type="1">text/plain</parameter>
      <parameter name="transport.vfs.ActionAfterProcess" locked="false" type="1">MOVE</parameter>
      <parameter name="transport.PollInterval" locked="false" type="1">15</parameter>
      <parameter name="transport.vfs.MoveAfterProcess" locked="false" type="1">file:///D:/WSO2/original</parameter>
   </service>
</serviceGroup>

When I am trying this, I am getting the below exception:

[2014-06-23 12:37:29,981] ERROR - AxisEngine The endpoint reference (EPR) for the Operation not found is /services/EDIMe
ssenger and the WSA Action = urn:mediate. If this EPR was previously reachable, please contact the server administrator.

org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is /services/EDIMessenger and the W
SA Action = urn:mediate. If this EPR was previously reachable, please contact the server administrator.
        at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:102)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:329)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:167)
        at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:403)
        at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
[2014-06-23 12:37:29,984] ERROR - ServerWorker Error processing POST request for : /services/EDIMessenger
org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is /services/EDIMessenger and the W
SA Action = urn:mediate. If this EPR was previously reachable, please contact the server administrator.
        at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:102)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:329)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:167)
        at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:403)
        at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

Any suggestions on what I may be doing wrong would be highly appreciated.

Please check the link below for testing your simple VFS file processing. The sample will read the data from a file, process each line inside sequence, and then move the process file into a predefined folder.

WSO2 ESB: File processing using VFS transport and mediation inside a sequence:
http://jayalalk.blogspot.com/2014/04/wso2-esb-file-processing-using-vfs.html

将localhost替换为计算机的IP地址,如果服务已启动并正在运行,则应该可以正常运行

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