
| port | the port number of the ftp server | 21 | No |
| user | the user login name used to connect to the server | | Yes (except when using FtpService) |
| password | the user password | | Yes (except when using FtpService) |
| folder | the folder on the FTP server | | No |
| filename | file name for the standard PUT operation (write the XML message content on the FTP server) | content.xml | No |
| 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) | active | No |
| transfer-type | transfer mode used for put or get files ascii/binary | ascii | No |
{table-plus}
*Table* \*2.2. Configuration of a Service Unit to provide a service (CDK)
|| Parameter \\ || Description \\ || Default value \\ || Required \\ ||
| wsdl-imports\- download | If false, the external imports declared in the service WSDL won't be downloaded, so they won't be replaced by their content. | True | No \\ |
| wsdl | Path to the WSDL document describing services and operations exposed by the provided JBI endpoints defined in the SU. \\
The value of this parameter is : \\
• an URL \\
• a file relative to the root of the SU package \\
If not specified, a basic WSDL description is automaticaly provided by the CDK. | \\ | No |
| timeout | Timeout in milliseconds of a synchronous send. this parameter can be used in conjunction with the sendSync(Exchange exchange) method of the Listeners. Set 0 for an infinite timeout. | | No |
|| Parameter || Description || Default value || Required ||
| wsdl-imports\- download | If false, the external imports declared in the service WSDL won't be downloaded, so they won't be replaced by their content. | True | No |
| wsdl | Path to the WSDL document describing services and operations exposed by the provided JBI endpoints defined in the SU. \\
The value of this parameter is : \\
• an URL \\
• a file relative to the root of the SU package \\
If not specified, a basic WSDL description is automaticaly provided by the CDK. | - | No |
| timeout | Timeout in milliseconds of a synchronous send. this parameter can be used in conjunction with the sendSync(Exchange exchange) method of the Listeners. Set 0 for an infinite timeout. | - {toc} | No |
| org.ow2.petals.messaging.provider.coa | Check Petals container document for further details. This propety activates the bypass of acknowledgment messages destinated to this SU. |
h3. 2.1.2. Service Unit content \\
The Service Unit has to contain the following elements, packaged in an archive:
\\
* The META-INF/jbi.xml descriptor file, has described above,
* An optional wsdl file describing the related service
{code}service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- service.wsdl (optional)
{code}
h3. 2.1.3. FTP Service
\\
The petals-bc-ftp component provides 5 operations, when using the Ftp service:
\\
* *dir* : return the files list on the FTP server
* *put* : copy incoming XML message on the FTP server
* *mput* : copy incoming message attachments on the FTP server
* *get* : get one specified file from the FTP server and return it as an XML message
* *mget* : get files from the FTP server and return them as attachments
When using the FTP service, you can optionnaly define the FTP connection information in your XML request. If you don't, the service unit parameters are used.
\\
To configure the FTP connection in your XML message request, you have to provide a connection element.
\\ {code}
...
<ver:connection>
<ver:server>server</ver:server>
<ver:port>port</ver:port>
<ver:user>user</ver:user>
<ver:password>password</ver:password>
<ver:folder>folder (optional)</ver:folder>
<ver:connection-mode>active|passive (optional, default is active)</ver:connection-mode>
<ver:transfer-type>ascii|binary|auto (optional, default is auto)</ver:connection-mode>
</ver:connection>
{code}
h4. 2.1.3.1. 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}
<ver:dir>
<!--Optional:-->
<ver:connection>
...
</ver:connection>
</ver:dir>{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.0">
<tns:filename>source.xml</tns:filename>
<tns:filename>test.xml</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 patterns are : *InOptionalOut*, *InOnly*, *RobustInOnly*.
\\
h4. 2.1.3.2. PUT operation
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}<ver:put xmlns:ver="http://petals.ow2.org/components/ftp/version-3.0">
<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 a Fault when an element in the request is missing or if the FTP connection failed
\\
The available exchange patterns are : *InOptionalOut*, *InOnly*, *RobustInOnly*.
\\
h4. 2.1.3.3. 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 :
\\
[http://petals.ow2.org/components/ftp/version-3.0]
{code}<ver:mput xmlns:ver="http://petals.ow2.org/components/ftp/version-3.0">
<!--Optional:-->
<ver:connection>
...
</ver:connection>
</ver:mput>
{code}
The service does not return a message.
\\
The service might return a Fault when an element in the request is missing or if the FTP connection failed
The available exchange patterns are : *InOptionalOut*, *InOnly*, *RobustInOnly*.
\\
\\
\\
h4. 2.1.3.4. 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 :
\\
[http://petals.ow2.org/components/ftp/version-3.0]