Petals-BC-Filetransfer

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

Changes (5)

View Page History
xmlns:filetransfer="http://petals.ow2.org/components/filetransfer/version-2.2"
xmlns:generatedNs="http://petals.ow2.org/filetransfer">

<jbi:services binding-component="false">
<jbi:consumes
service-name="generatedNs:FileRepoService"
endpoint-name="getServiceEndpoint">

<!-- CDK specific fields -->
<petalsCDK:operation>test</petalsCDK:operation>
<petalsCDK:mep>InOnly</petalsCDK:mep>

<!-- FileTransfer specific fields -->
<filetransfer:read-directory>${PETALS_HOME}/filetransfer/in</filetransfer:read-directory>
h4. GetFile operation

When the getFile operation is set on the incoming message exchange, the component returns the first file found in the&nbsp;configured directory, according to the file filter set in the XML request (the source of the IN message). The file is returned&nbsp;as an XML response message (OUT message), so the file MUST be an XML file \!

The IN message looks like :
{code:lang=xml}<q0:getFile xmlns:q0="http://petals.ow2.org/components/filetransfer/version-2.2">
<q0:filepattern>*.xml</q0:filepattern>
</q0:getFile>{code}
The OUT message returned to the consumer contains the XML content of the first file matching the pattern, in its source :

The read file is moved to the configured backup directory (backup-directory) or in the system default temporary&nbsp;directory.
{note}This operation is defined in the File Transfer abstract WSDL. You can import this abstract WSDL and define a&nbsp;concret WSDL to reference in your SU. Thus the service provided is properly defined by its WSDL.{note}

h4. GetFiles operation

When the getFiles operation is set on the incoming message exchange, the component returns all the files file found in
the configured directory (read-directory), according to the files filters set in the XML request. The files are all returned
as attachments. An XML report message is returned.
When the getFiles operation is set on the incoming message exchange, the component returns all the files file found in&nbsp;the configured directory (read-directory), according to the files filters set in the XML request. The files are all returned&nbsp;as attachments. An XML report message is returned.

The IN message looks like :
{code:lang=xml}<q0:getFiles xmlns:q0="http://petals.ow2.org/components/filetransfer/version-2.2">
<q0:filepattern>*.xml</q0:filepattern>
<q0:filepattern>picture.jpg</q0:filepattern>
<q0:filepattern>document??.doc</q0:filepattern>
</q0:getFiles>{code}
The OUT message returned to the consumer is defined as follow :
{code:lang=xml}<q0:getFilesResponse xmlns:q0="http://petals.ow2.org/components/filetransfer/version-2.2">
<q0:filename>file1.xml</q0:filename>
<q0:filename>file2.xml</q0:filename>
<q0:filename>picture.jpg</q0:filename>
<q0:filename>document_1.doc</q0:filename>
<q0:filename>document_2.doc</q0:filename>
</q0:getFilesResponse>{code}
Files are returned as attachments.

The read files are moved to the configured backup directory (backup-directory) or in the system default temporary&nbsp;directory.
{note}This operation is defined in the File Transfer abstract WSDL. You can import this abstract WSDL and define a&nbsp;concret WSDL to reference in your SU. Thus the service provided is properly defined by its WSDL.{note}