PEtALS-BC-FTPThe petals-bc-ftp component allows to put, get or list files on an FTP server.
Component 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: Configuration of the component (CDK)Unable to render {include} Couldn't find a page to include called: 0 CDK Component Configuration Table
Configuration of a Service Unit to consume a service (CDK)Configuration of a Service Unit to consume a service (JBI)
Configuration of a Service Unit to consume a service (CDK)
Service ConfigurationPut XML content or send FTP commands to the FTP serverPROVIDE 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. 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.
2.1.1. Service Unit descriptorThe service unit is configurable via its extensions in the jbi.xml file:
<?xml version="1.0" encoding="UTF-8"?> <!-- JBI descriptor for PEtALS' "petals-bc-ftp" (FTP), version 3.0 --> <jbi:jbi version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:ftp="http://petals.ow2.org/components/ftp/version-3.0" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-4.0" xmlns:interfaceNs="http://petals.ow2.org/components/ftp/version-3.0" xmlns:serviceNs="http://myservice"> <!-- Import a Service into PEtALS or Expose a PEtALS Service => use a BC. --> <jbi:services binding-component="true"> <!-- Import a Service into PEtALS => provides a Service. --> <jbi:provides interface-name="interfaceNs:Ftp" service-name="serviceNs:FtpSrv" endpoint-name="FtpSrvEndpoint"> <!-- CDK specific elements --> <petalsCDK:wsdl>ftp.wsdl</petalsCDK:wsdl> <!-- Component specific elements --> <ftp:server>server</ftp:server> <ftp:port>21</ftp:port> <ftp:user>user</ftp:user> <ftp:password>password</ftp:password> <ftp:folder>folder</ftp:folder> <ftp:filename>file.xml</ftp:filename> </jbi:provides> </jbi:services> </jbi:jbi
Table *2.2. Configuration of a Service Unit to provide a service (CDK)
2.1.2. Service Unit content
The 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) 2.1.3. FTP Service
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.
... <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> 2.1.3.1. DIR operation
<ver:dir> <!--Optional:--> <ver:connection> ... </ver:connection> </ver:dir> The OUT message returned to the consumer is defined as follow : <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> 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.
2.1.3.2. PUT operationWhen 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 : <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> 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.
2.1.3.3. MPUT operationWhen the mput operation is set on the incoming IN message, the component write the attachments on the FTP server. The IN message looks like :
<ver:mput xmlns:ver="http://petals.ow2.org/components/ftp/version-3.0">
<!--Optional:-->
<ver:connection>
...
</ver:connection>
</ver:mput>
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.
2.1.3.4. GET operationWhen 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 :
<ver:get xmlns:ver="http://petals.ow2.org/components/ftp/version-3.0">
<ver:filename>file name to retrieve</ver:filename>
<!--Optional:-->
<ver:connection>
...
</ver:connection>
</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 the FTP connection failed
The available exchange patterns are : InOptionalOut and InOut. 2.1.3.5. MGET operationWhen 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 :
<ver:mget xmlns:ver="http://petals.ow2.org/components/ftp/version-3.0"> <!--1 or more repetitions:--> <ver:filename>*.xml</ver:filename> <ver:filename>myFile.txt</ver:filename> <!--Optional:--> <ver:connection> ... </ver:connection> </ver:mget> The OUT message returned to the consumer contains files, as attachments, and an XML message report :
<tns:mgetResponse xmlns:tns="http://petals.ow2.org/components/ftp/version-3.0"> <tns:filename>source.xml</tns:filename> <tns:filename>source2.xml</tns:filename> <tns:filename>myFile.txt</tns:filename> </tns:mgetResponse> 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, InOut. |
Table of contents Contributors
No contributors found for: authors on selected page(s)
|