Invoking a Service when a File appears

compared with
Current by Vincent Zurczak
on Feb 12, 2012 19:35.

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

Changes (9)

View Page History

Start Petals Studio.
In the menu, select *File > New > Service-Unit Project*. Petals Service Provider*.
If you do not see it, go into *File > New > Other...* Then, select *Service-Unit Project* *Petals Service Provider* under the *Petals* category.

\\
In the *Use Case* list, select *Communication*.
In the *Petals Component* list, select *File Transfer // petals-bc-filetransfer*.
In the *Component Usage* list, select *Consume a Petals service (or Expose it outside the bus)*.
In the *Component Version* list, select the version of the Petals-BC-FileTransfer that you are using in Petals.

\\
In the scope of this tutorial, we are going to work with the version 2.4 3.0 of the File Transfer component.
Which gives us:


\\
This page also defines the operation to invoke and the Message Exchange Pattern (MEP).
The Message Exchange Pattern (MEP) defines the interactions between the File Transfer component and the invoked service.
With this component, only operations that work with the InOnly MEP can be invoked.

\\
You can obviously fill-in these fields by hand.
However, the most efficient way is to use the [Petals Services explorer|Getting familiar with the Petals Services view] (provided it was populated).


h2. Specifying the CDK parameters Transfer Mode

The CDK is the Petals framework to develop JBI components.
The Petals-BC-FileTransfer component was developed with this framework.
There are 3 possible transfer modes.
* One loads the content file and sends it as a Petals message. The file must be a XML file.
* Another sends a static message with the file as attachment. Any kind of file can be used.
* And the last one is a new mode, more compatible with the SOA paradigm than the 2 previous ones. This last mode expects a message skeleton to be defined. Variables can be used to either put the file as attachment, or to insert the file content in the XML message. This approach allows to send messages that respect the service contract (WSDL) of the target service.

This page requires information related to the CDK.
If the service to consume is described by a WSDL, then there is a list of the possible operations that can be invoked.
Otherwise, you have three parameters to complete here (others are optional or have default values):
* The name space of the invoked operation's name (WSDL operations are QNames).
* The local part of the invoked operation's name (WSDL operations are QNames).
* The Message Exchange Pattern (MEP).

\\
With this component, only operations that work with the *InOnly* MEP can be invoked.
The wizard only shows these operations.

The meaning of all the CDK parameters for File Transfer can be found in the documentation of the [Petals-BC-FileTransfer|petalscomponents:Petals-BC-Filetransfer] component.

\\ !petals-studio-tuto-consumes-ft-6.jpg!