-
1. Re: File Transfer
jorgemoralespou_2 Aug 25, 2014 6:55 AM (in response to ptjcarlo)1 of 1 people found this helpfulHi,
I would probably use a:
- File service
- Camel component
- FTP reference
With this should be straight forward to implement.
-
2. Re: File Transfer
ptjcarlo Aug 28, 2014 5:04 AM (in response to jorgemoralespou_2)Thanks Jorge
I tried to create java class that implements getting a file in a local directory and put it in ftp server. However, got an error message while enabling the service in EAP,
"Internal Server Error
{
"outcome" => "failed",
"failure-description" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"FileToFTP_proj-0.0.1-SNAPSHOT.jar\".SwitchYardService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"FileToFTP_proj-0.0.1-SNAPSHOT.jar\".SwitchYardService: org.switchyard.SwitchYardException: SWITCHYARD030412: Unknown Service name '{urn:com.example.switchyard:FileToFTP_proj:1.0}FTPUploaderService'.
Caused by: org.switchyard.SwitchYardException: SWITCHYARD030412: Unknown Service name '{urn:com.example.switchyard:FileToFTP_proj:1.0}FTPUploaderService'."}},
"rolled-back" => true
}
"
File/FTP binding and Java Interface (FTPUploaderService') -> Java Bean component (FTPUploaderServiceBean_new)
-
3. Re: Re: File Transfer
jorgemoralespou_2 Oct 7, 2014 2:47 PM (in response to ptjcarlo)Hi Carlo,
I don't know how you are progressing with this, but it should be easier than that.
Just to get you started:
<?xml version="1.0" encoding="UTF-8"?> <sy:switchyard xmlns:camel="urn:switchyard-component-camel:config:1.1" xmlns:file="urn:switchyard-component-camel-file:config:1.1" xmlns:ftp="urn:switchyard-component-camel-ftp:config:1.1" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:sy="urn:switchyard-config:switchyard:1.1" name="file2ftp-example" targetNamespace="urn:com.example.switchyard:file2ftp-example:1.0"> <sca:composite name="file2ftp-example" targetNamespace="urn:com.example.switchyard:file2ftp-example:1.0"> <sca:component name="File2FTPRoute"> <camel:implementation.camel> <camel:java class="com.example.switchyard.file2ftp_example.File2FTPRoute"/> </camel:implementation.camel> <sca:service name="FileService"> <sy:interface.esb inputType="java:java.lang.String"/> </sca:service> <sca:reference name="FTPService"> <sy:interface.esb inputType="java:java.lang.String"/> </sca:reference> </sca:component> <sca:service name="FileService" promote="File2FTPRoute/FileService"> <sy:interface.esb inputType="java:java.lang.String"/> <file:binding.file name="file1"> <file:directory>/tmp</file:directory> <file:fileName>input.txt</file:fileName> <file:consume/> </file:binding.file> </sca:service> <sca:reference name="FTPService" multiplicity="0..1" promote="File2FTPRoute/FTPService"> <sy:interface.esb inputType="java:java.lang.String"/> <ftp:binding.ftp name="ftp1"> <ftp:directory>/tmp</ftp:directory> <ftp:fileName>output.txt</ftp:fileName> <ftp:host>localhost</ftp:host> <ftp:port>21</ftp:port> <ftp:username>user</ftp:username> <ftp:password>password</ftp:password> <ftp:produce/> </ftp:binding.ftp> </sca:reference> </sca:composite> </sy:switchyard>