Petals-BC-FTP

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (27)

View Page History
{include:0 CDK SU Provide Configuration}

h2. Put XML content or send Send FTP commands to the FTP server

PROVIDE SERVICE : Expose an external service in the JBI environment to put XML messages or send FTP commands on an FTP server.

Petals FTP binding component allows JBI consumers to send XML messages to an FTP server. A JBI endpoint is registered into the JBI environment, and is linked to an FTP server, with a configured user/password. When the FTP component receives a message exchange from Petals platform, the XML content of the message is put on the FTP server.
Petals FTP binding component allows JBI consumers to call FTP command. A JBI endpoint is registered into the JBI environment, and is linked to an FTP server, with a configured user/password.To use this service, the consumer has to call explicitely the *{service* *namespace{*}*}get/mget/put/mput/dir/del* operations.When the FTP component receives a message exchange from Petals platform, it call the FTP command associate with the jbi operation.

The component can also provide a generic *Ftp service*. This service allows the consumer to call FTP commands. This service can either connects to an FTP server configured in the ServiceUnit, or retrieve the FTP server information in the XML message request.
This service can either connects to an FTP server configured in the ServiceUnit, or retrieve the FTP server information in the XML message request.
\\
To use this generic service, the consumer has to call explicitely the *\{service* \*namespace\}get/mget/put/mput/dir\* operations. Otherwise, the standard PUT operation is called.
\\

h3. 2.1.1. Service Unit descriptor



The service unit is configurable via its extensions in the jbi.xml file:
\\
</jbi:jbi{code}
\\
*Table* *2.1. Service &nbsp; *Service Unit attributes to provide services*
{table-plus}





















|| Attribute || Description || Default value || Required ||
| server | IP or DNS name of the server | | Yes (except when uins FtpService) |
{table-plus}

h3. 2.1.2. Service Unit content \\
h3. Service Unit content&nbsp;



The Service Unit has to contain the following elements, packaged in an archive:
\\
{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
* *dir* : return the files list on the FTP server
* *del* : remove file on the FTP server

            <ver:encoding>?</ver:encoding>
         </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:lang=xml}
<ver:dir>
   <!--Optional:-->
   <ver:connection>
     ...
   </ver:connection>
</ver:dir>{code}
The OUT message returned to the consumer is defined as follow :
h4. PUT operation

{code:lang=xml}<tns:dirResponse xmlns:tns="http://petals.ow2.org/components/ftp/version-3.0">
         <!--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*.
\\

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.
\\
\\

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.
\\

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.


h4. 2.1.3.5. 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.

The available exchange pattern is : *InOut*.

h4. 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}
<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">
         <!--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*.

h4. 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}
<ver:del>
<ver:filename>?</ver:filename>
<!--Optional:-->
<ver:connection>
...
</ver:connection>
</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.
{column}
{column:width=350px}