
When the put operation is set on the incoming IN message, the component write the XML message to the FTP server.
The IN message looks like :
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<ver:put xmlns:ver="http://petals.ow2.org/components/ftp/version-3">
<ver:body>xml body</ver:body>
<ver:filename>file name on the FTP server</ver:filename>
<!--Optional:-->
<ver:connection>
...
</ver:connection>
</ver:put>
{code}
The service does not return a message.
The service might return an error when an element in the request is missing or if the FTP connection failed.
The available exchange pattern is : *InOnly*.
h3. MPut Operation
When the mput operation is set on the incoming IN message, the component write the attachments on the FTP server.
The IN message looks like :
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<ver:mput xmlns:ver="http://petals.ow2.org/components/ftp/version-3">
<ver:attachments>
<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>
{code}
The service does not return a message.
The service might return an error when an element in the request is missing or if the FTP connection failed.
The available exchange pattern is : *InOnly*.
h3. Get Operation
When the get operation is set on the incoming IN message, the component retrieve ONE file from the FTP server 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 :
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<ver:get xmlns:ver="http://petals.ow2.org/components/ftp/version-3">
<ver:filename>file name to retrieve</ver:filename>
</ver:get>
{code}
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 the FTP connection failed.
The available exchange patterns is : *InOut*.
{info}Only xml file could be processed otherwise an error will be raised.{info}
h3. GetAsAttachment Operation
When the get operation is set on the incoming IN message, the component retrieve ONE file from the FTP server and return it as an attachment.
The name of the file to retrieve is set in the XML IN content of the message.
The IN message looks like :
{code:lang=xml}
<?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>
{code}
The OUT message returned to the consumer contains the retrieved file, as attachment:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<tns:getAsAttachmentResponse xmlns:tns="http://petals.ow2.org/components/ftp/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>
{code}
The service might return a Fault when an element in the request is missing or if the FTP connection failed.
The available exchange pattern is : *InOut*.
h3. MGet Operation
When the mget operation is set on the incoming IN message, the component retrieves files from the FTP server, according to the file names (or filters) set in the XML request.
There is no recursivity, sub folders are ignored.
Each file is set in the OUT message as an attachment. The IN message looks like:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<ver:mget xmlns:ver="http://petals.ow2.org/components/ftp/version-3">
<!--1 or more repetitions:-->
<ver:filename>*.xml</ver:filename>
<ver:filename>myFile.txt</ver:filename>
</ver:mget>
{code}
The OUT message returned to the consumer contains files, as attachments:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<tns:mgetResponse xmlns:tns="http://petals.ow2.org/components/ftp/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:test2.xml"/></tns:filename>
</tns:attachments>
</tns:mgetResponse>
{code}
The service might return a Fault when an element in the request is missing or if the FTP connection failed.
The available exchange pattern is : *InOut*.
h3. Dir Operation
When the dir operation is set on the incoming IN message, the component returns the file names listed from the FTP server.
The IN message looks like:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<ver:dir xmlns:ver="http://petals.ow2.org/components/ftp/version-3" />
{code}
The OUT message returned to the consumer is defined as follow :
{code:lang=xml}
<tns:dirResponse xmlns:tns="http://petals.ow2.org/components/ftp/version-3">
<!--Zero or more repetitions:-->
<tns:filename>file1.txt</tns:filename>
<tns:filename>linux.jpg</tns:filename>
</tns:dirResponse>
{code}
The service might return a Fault when an element in the request is missing or if the FTP connection failed.
The available exchange pattern is : *InOut*.
h3. Del Operation
When the del operation is set on the incoming IN message, the component delete the remote file.
The IN message looks like :
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?><ver:del xmlns:ver="http://petals.ow2.org/components/ftp/version-3">
<ver:filename>?</ver:filename>
</ver:del>
{code}
The service does not return a message.
The service might return an Error when an element in the request is missing or if the FTP connection failed.
The available exchange pattern is : *InOnly*.
h2. Configuration
All needed information must be defined in the service-unit JBI descriptor. This JBI descriptor is configured through parameters divided in following groups:
* *JBI parameters* that defines the service provider identification,
* *CDK parameters* that are parameters driving the service provider implementation at CDK layer,
* *CDK interceptor parameters* that are parameters driving interceptors at CDK layer,
* *Dedicated parameters* that are parameters driving the service provider implementation at component layer.
h3. CDK parameters defining service provider implementation
The following parameters correspond to the CDK configuration of the service provider implementation.
{include:0 CDK SU Provide Configuration 5.8.0}
h3. CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.
{include:0 CDK SU Interceptor configuration 5.8.0}
h3. Dedicated configuration
The following parameters correspond to the component specific configuration of the service provider implementation.
{anchor:connection-parameters}
{table-plus}
|| Parameter || Description || Default || Required ||
| server | IP or DNS name of the server | {center}\-{center} | {center}Yes{center}{center}except when using FtpService{center} |
| port | the port number of the FTP server | {center}21{center} | {center}No{center} |
| user | the user login name used to connect to the server | {center}\-{center} | {center}Yes{center}{center}except when using FtpService{center} |
| password | the user password | {center}\-{center} | {center}Yes{center}{center}except when using FtpService{center} |
| folder | the folder on the FTP server | {center}\-{center} | {center}No{center} |
| filename | file name for the standard PUT operation (write the XML message content on the FTP server) | {center}content.xml{center} | {center}No{center} |
| connection-mode | In Active mode, the connection port is set by the client. In Passive mode, it is set by the server (default is Active) | {center}active{center} | {center}No{center} |
| transfer-type | transfer mode used for put or get files ascii/binary | {center}ascii{center} | {center}No{center} |
| delete-processed-files | If true, the service delete the files processed by operation get or mget | {center}false{center} | {center}No{center} |
| encoding | Set the encoding encoding value used to process FTP operation | {center}Default JVM Encoding{center} | {center}No{center} |
| max-idle-time | Max idle connection time (milliseconds). Default value is 10000ms | {center}10000 ms{center}\\ | {center}No{center}\\ |
| max-connection | This parameter specifies the maximum number of simultaneous connection allowed by the FTP server. \\ | {center}\-1 (unlimited){center}\\ | {center}No{center}\\ |
{table-plus}
h3. Service unit content
The service unit has to contain the following elements, packaged in the archive:
* the META-INF/jbi.xml descriptor file as described above,
* it is also highly recommended to provide a WSDL description for service provider embeded in the service-unit. The service provider contract must implement the interface "\{http://petals.ow2.org/components/ftp/version-3}Ftp" defined in the abstract WSDL 'FtpServiceInterface.wsdl' available as resource in the component archive.
{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- service.wsdl (optional)