FeatureThe FileTransfer component is a Binding Component (BC) which supports file transfers. This component allows to:
Exposing a file system access as a service
UsagePut OperationWhen the put operation is set on the incoming IN message, the component writes the XML message to the configured directory. The created file takes the name described in the service unit (filename parameter) otherwise the operation name is taken. For each file created, the system date is appended to this file name. The IN message looks like : <?xml version="1.0" encoding="UTF-8"?> <ver:put xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3">?</ver:put> The service does not return a message. MPut OperationWhen the mput operation is set on the incoming IN message, the component writes the attachments on the configured directory. <?xml version="1.0" encoding="UTF-8"?> <ver:mput> <ver:attachments xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3"> <!--1 or more repetitions:--> <ver:filename><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:test1.xml"/></ver:filename> <ver:filename><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:test2.xml"/></ver:filename> </ver:attachments> </ver:mput> The service does not return a message. The available exchange pattern is : InOnly. Get OperationWhen the get operation is set on the incoming IN message, the component retrieves ONE file from the configured directory and return it as an XML message content.
The name of the file to retrieve is set in the XML IN content of the message.
The IN message looks like :
<?xml version="1.0" encoding="UTF-8"?> <ver:get xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3"> <ver:filename>file name to retrieve</ver:filename> </ver:get> The OUT message returned to the consumer is the content of the XML file
The service might return a Fault when an element in the request is missing or if an IO error occurs.
The available exchange patterns is : InOut.
GetAsAttachement OperationWhen the getAsAttachment operation is set on the incoming IN message, the component retrieve ONE file from the configured directory according to the filename(or filter) set in the XML request. The IN message looks like : <?xml version="1.0" encoding="UTF-8"?> <ver:getAsAttachment xmlns:ver="http://petals.ow2.org/components/ftp/version-3"> <ver:filename>file name to retrieve</ver:filename> </ver:getAsAttachment> The OUT message returned to the consumer contains files, as attachments, and an XML message report : <?xml version="1.0" encoding="UTF-8"?> <tns:getAsAttachmentResponse xmlns:tns="http://petals.ow2.org/components/filetransfer/version-3"> <tns:attachment> <tns:filename><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:test1.xml"/></tns:filename> </tns:attachment> </tns:getAsAttachmentResponse> The service might return a Fault when an element in the request is missing or if an IO error occurs. The available exchange pattern is : InOut. MGet OperationWhen the mget operation is set on the incoming IN message, the component retrieves files from the configured directory, according to the filenames (or filters) set in the XML request. Each file is set in the OUT message as an attachment. <?xml version="1.0" encoding="UTF-8"?> <ver:mget xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3"> <\!\--1 or more repetitions:-\-> <ver:filename>*.xml</ver:filename> <ver:filename>myFile.txt</ver:filename> </ver:mget> The OUT message returned to the consumer contains files, as attachments: <?xml version="1.0" encoding="UTF-8"?> <tns:mgetResponse xmlns:tns="http://petals.ow2.org/components/filetransfer/version-3"> <tns:attachments> <tns:filename><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:test1.xml"/></tns:filename> <tns:filename><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:myFile.txt"/></tns:filename> </tns:attachments> </tns:mgetResponse> The service might return a Fault when an element in the request is missing or if an IO error occurs. The available exchange pattern is : InOut. Del OperationWhen the del operation is set on the incoming IN message, the component deletes the remote file. The IN message looks like : <?xml version="1.0" encoding="UTF-8"?> <ver:del xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3"> <ver:filename>?</ver:filename> </ver:del> The service does not return a message. The available exchange pattern is : InOnly. CheckFile OperationWhen the check operation is set on the incoming IN message, the component check <ver:checkFile xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3"> <ver:filename>?</ver:filename> </ver:checkFile> The OUT message returned to the consumer looks like : <ver:checkFileResponse xmlns:ver="http://petals.ow2.org/components/filetransfer/version-3"> <ver:filename>?</ver:filename> <ver:exist>true|false</ver:exist> </ver:checkFileResponse> The service might return an ioFault. ConfigurationConfiguration of a Service Unit to provide a service (JBI)
Configuration of a Service Unit to provide a service (CDK)
Service Unit attributes to provide services
Service Unit descriptorThe service unit is configurable via its extensions in the jbi.xml file:
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" version="1.0"> <jbi:services binding-component="true"> .... </jbi:services> </jbi:jbi> Service Unit contentThe Service Unit has to contain the following elements, packaged in an archive:
service-unit.zip + META-INF - jbi.xml (as defined above) - service.wsdl (optional) Invoking service on incoming fileConfigurationsService Unit descriptorComponent ConfigurationThe following attributes can be set during the installation phase to configure the component, using the params element of the jbi-install-component ANT task: Unable to render {include} Couldn't find a page to include called: 0 CDK Component Configuration Table
Definition of CDK parameter scope :
|
Table of contents Contributors
No contributors found for: authors on selected page(s)
|