私の目標は、与えられたパターン(私の場合はD [MMDDYYYY]〜[MMDDYYYY])に一致するファイルのリストを探し、返されたファイル名のリストを反復し、それらを宛先にコピーします。 fileconnector.search操作の結果を正しく解析する方法がわかりません。 fileconnector.searchが返すファイル名を解析するための正しいXPath式は何ですか?私のコードと出力は以下の通りです。WSO2でfileconnector.search(v2)から結果を読み取る方法ESB
ありがとうございます。
<sequence name="TestFTPDownloadSeq" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<fileconnector.search>
<source>ftp://username:[email protected]/data/</source>
<filePattern>D08082016/.+/.csv</filePattern>
<recursiveSearch>false</recursiveSearch>
</fileconnector.search>
<iterate expression="//file" xmlns:ns2="http://org.apache.synapse/xsd" xmlns:sec="http://secservice.samples.esb.wso2.org">
<target>
<sequence>
<property expression="//file" name="fileName"
scope="default" type="STRING"/>
<fileconnector.copy>
<source>ftp://username:[email protected]/data/</destination>
<destination>C:/MyApps/data/in</destination>
<filePattern>{$ctx:fileName}</filePattern>
</fileconnector.copy>
<drop/>
</sequence>
</target>
</iterate>
</sequence>
ログファイル
[2016-08-10 13:00:08,519] DEBUG - TemplateMediator Start : EIP Sequence paramNames : [source, filePattern, recursiveSearch, setTimeout, setPassiveMode, setSoTimeout, setStrictHostKeyChecking, setUserDirIsRoot]
[2016-08-10 13:00:08,519] DEBUG - TemplateMediator Sequence <TemplateMediator> :: mediate()
[2016-08-10 13:00:08,519] DEBUG - TemplateMediator Mediation started from mediator position : 0
[2016-08-10 13:00:08,519] DEBUG - TemplateMediator Building message. Sequence <TemplateMediator> is content aware
[2016-08-10 13:00:08,519] DEBUG - PropertyMediator Start : Property mediator
[2016-08-10 13:00:08,519] DEBUG - PropertyMediator Setting property : source at scope : default to : ftp://username:[email protected]/data/ (i.e. result of expression : $func:source)
[2016-08-10 13:00:08,519] DEBUG - PropertyMediator End : Property mediator
[2016-08-10 13:00:08,519] DEBUG - PropertyMediator Start : Property mediator
[2016-08-10 13:00:08,519] DEBUG - PropertyMediator Setting property : filePattern at scope : default to : D08082016/.+/.csv (i.e. result of expression : $func:filePattern)
[2016-08-10 13:00:08,519] DEBUG - PropertyMediator End : Property mediator
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator Start : Property mediator
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator Setting property : recursiveSearch at scope : default to : false (i.e. result of expression : $func:recursiveSearch)
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator End : Property mediator
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator Start : Property mediator
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator Setting property : setTimeout at scope : default to : null (i.e. result of expression : $func:setTimeout)
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator End : Property mediator
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator Start : Property mediator
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator Setting property : setPassiveMode at scope : default to : null (i.e. result of expression : $func:setPassiveMode)
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator End : Property mediator
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator Start : Property mediator
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator Setting property : setSoTimeout at scope : default to : null (i.e. result of expression : $func:setSoTimeout)
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator End : Property mediator
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator Start : Property mediator
[2016-08-10 13:00:08,520] DEBUG - PropertyMediator Setting property : setStrictHostKeyChecking at scope : default to : null (i.e. result of expression : $func:setStrictHostKeyChecking)
[2016-08-10 13:00:08,521] DEBUG - PropertyMediator End : Property mediator
[2016-08-10 13:00:08,521] DEBUG - PropertyMediator Start : Property mediator
[2016-08-10 13:00:08,521] DEBUG - PropertyMediator Setting property : setUserDirIsRoot at scope : default to : null (i.e. result of expression : $func:setUserDirIsRoot)
[2016-08-10 13:00:08,521] DEBUG - PropertyMediator End : Property mediator
[2016-08-10 13:00:08,521] DEBUG - ClassMediator Start : Class mediator
[2016-08-10 13:00:08,521] DEBUG - ClassMediator invoking : class org.wso2.carbon.connector.FileSearch.mediate()
[2016-08-10 13:00:08,547] DEBUG - ClassMediator End : Class mediator
[2016-08-10 13:00:08,547] DEBUG - IterateMediator Start : Iterate mediator
[2016-08-10 13:00:08,550] DEBUG - IterateMediator Splitting with XPath : //file resulted in 0 elements
https://medium.com/@lmanohara99/wso2-esb-file-connector-version-2-f789ad389d7d#.2ivi97d9x作品に解決のための!手伝ってくれてどうもありがとう。 –