WSO2 ESB | VFS到服务调解

时间:2014-06-23 07:43:42

标签: wso2 esb vfs

我想从FTP服务器读取一组文件,然后将其传递给我的服务进行转换,然后将转换后的文件通过VFS发送到输出文件夹。我配置了VFS协议并配置了端点。请参阅下面的配置:

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

服务配置如下:

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

当我尝试这个时,我得到以下异常:

[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)

对于我可能做错的任何建议都将受到高度赞赏。

2 个答案:

答案 0 :(得分:2)

请检查以下链接以测试简单的VFS文件处理。该示例将从文件中读取数据,处理序列中的每一行,然后将流程文件移动到预定义的文件夹中。

WSO2 ESB:使用序列内的VFS传输和中介进行文件处理:
http://jayalalk.blogspot.com/2014/04/wso2-esb-file-processing-using-vfs.html

答案 1 :(得分:0)

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