SOA 12c - FTP Adapter (Put File)

Here we go!
Information that you need to know:

The Oracle FTP Adapter works the same as the Write File operations of the Oracle File Adapter. The Oracle FTP Adapter receives messages from a BPEL process or a Mediator service and writes the messages in a file to a file system (in this case, remote). Because the messages must be written to a remote system, the Adapter Configuration Wizard prompts you to connect to the FTP server with the adapter instance JNDI name. For more detailed information read the following URL: https://docs.oracle.com/html/E10231_03/adptr_file.htm#CIAHJAEB

In this post, we will learn how create a SOA Project with FTP Adapter - Operation Type: Put File (outbound operation).

The next images are the SOA Project execution:

Now we are going to open JDeveloper IDE and click on File menu > New > Application.

For example:


On the Application window, set the next values, and click on next button.
Application Name FTPAdapter
Directory C:\JDeveloper\mywork\FTPAdapter
Application Package Prefix

For example:


On the Project window, set the next values, and click on next button.
Project Name  PutFile
Directory C:\JDeveloper\mywork\FTPAdapter\PutFile

For example:


On the Configure SOA settings window, set the next values, and click on finish button.
Standard Composite  Empty Composite

For example:


After clicking on finish button, the JDeveloper IDE has the next appearance:

Well for this exercise we are going to use one exercise created previously as a reference, what we are going to do is basically poll a table every 5 seconds and once the information is recovered we are going to write it to a remote FTP, so we are going to use XXISC_FGG_EMPLOYEES as data source.


You can find the exercise used as a reference by clicking on the following link: DB Adapter (Poll for New or Changed Records in a Table).

So after this activity is completed, our project should look like this:

Then the next step, on External References section right click > Insert > FTP, then enter the ftpReference value on FTP Name, then click on next button.

For Example:

Then on Adapter Interface click on next button.

Then on FTP Server Connection put your value, in this practice we already created a FTP Server Connection on Weblogic: eis/Ftp/FtpAdapter click on next button.

Then on Operation select Ascii as a File Type and Put File as a Operation type, click on next button.

Then on File Directories, put the directory for outgoing files, then click on next button.

Then on Message, click on Define Schema for Native Format.

For Example:

Note: If you already created the XSD file you can just select it.

Once the Native Format Builder window is displayed we have 8 steps to generate our XSD.



Then on File Name and Directory, set the next values, and click on next button.

File Name nxsd_schema1.xsd
Directory Name  C:\JDeveloper\mywork\FTPAdapter\PutFile\SOA\Schemas
For Example:

Then on Choose Type, select Delimited such as Select file type.

Select file type  Delimited (Contains records whose fileds are delimited by a scpecial character)
For Example:

Then on File Description, we need specify name of the file that you want to sample. So, we need do click on Browse button and then select its respective file.
In our case we are going to change the value of Character set by UTF-8, then click on next button.
Note: We will leave the rest of the values as they are by default.

For Example:

Then on Record Organization, we are going to select File contains multiple record instances, then select Multiple records are of single type.
Click on next button.

For Example:

Then on Specify Elements, we are going to fill the target namespace and the element names.

For the Target namespace we are going to put http://TargetNamespace.com/ftpReference, this value is pupulated by default.
By default the name of the element containing multiple records are Root-Element we are going to maintain the same value.
We are going to put employee such as name for element that will represent record.
Click on next button.

For Example:

Then on Specify Delimiters, we are goint to select End of Line($eol) such as records delimiter and select Comma (,) such as fields delimiter, and the rest of the values will be kept by default.
Note: The delimiter depends of your delimiter file, in our case we have "," such as delimiter.
Click on next button.

For Example:

Then on Field Properties, we are going to specify the field names and field properties.

For Example:

In the current window we are going to view our generated native format schema.
We are going to do click on Test button just to validate if all the previously steps are success.

For Example:

Then on Finish, click on finish button.

Then, returning to the Message step, we are going to select our xsd generated and the Root-Element such as Schema Element, then click on next and click on finish.

Now we need drag to add a new Reference, with this action we will have available the Partner Links on .bpel file.

For example:

Now we are going to do double click on component: BPELProcessPutFile, then on BPELProcessPutFile.bpel file, we need to select the Invoke activity and drag to work area after of receiveInput and change the name from Invoke1 to InvokeFtpReference

For example:

Then we need to drag onto a Partner Link to make a Web Service connection. On the Edit Invoke window, set the next values, and click on ok button.

Input Variable  ftpInputVariable
Type {http://xmlns.oracle.com/pcbpel/adapter/ftp/FTPAdapter/PutFile/ftpReference}Put_msg

For example:

Then click on Apply button, next click on Ok button,then click on Save All button

The next step we are going to create a XSL file to map the source (our custom table) and the target (Put File operation), so we are going to use the transformation component once completed our XSL file should look like this:

Now the next step is create a jar file to can deploy it on WebLogic Server, we need to select the PutFile project and righ click, then chose the PutFile... option.

For example:


On the Deployment Action window, set the next values, and click on next button.
Deployment Action  Generate SAR File

For example:


On the Deployment Configuration window, set the next values, and click on next button.
New Revision ID  1.0

For example:


On the Deployment Summary window, click on Finish button.
For example:


If all steps were successful, then you will view on yours JDeveloper IDE the correctly deployment.
For example:

Comments