Using the FTP Adapter in OSB 11g

I recently had to configure an OSB Proxy and Business Service to use the FTP Adapter via the JCA Transport.
Here are the steps to get it working.

Step 1
Before you configure OSB, you need three artifacts:
  1. XML Schema
  2. JCA Adapter Configuration File
  3. The WSDL that describes your inputs (Proxy Service) and outputs (Business Service)
Rather than detailing this step, you can find the information on how to create them via JDeveloper here:
Using JCA Adapters with OSB 11.1.1.3

Step 2
Now you need to configure the FTP Adapter Resource inside the WebLogic domain. WebLogic automatically deploys an number of JCA Adapters, including the FTP Adapter when you create a domain.

FTPResourceAdapter002.png


For the FTP Adapter, you can either create a new connection factory or update an existing one. My preference is to create a new dedicated one. The steps are:
  1. Login to Weblogic Admin Console.
  2. Navigate to Deployments --> FtpAdapter --> Configuration Tab --> Outbound Connection Pools.
  3. Expand javax.resource.cci.ConnectionFactory.
  4. To create new, click on new button and create one. My example uses the JNDI name of eis/ftp/SampleFtpAdapter.
  5. After clicking on the connection factory name, you will be able to see 10 out of 55 Outbound Connection Properties.
  6. Update the username, password, port and host properties to point to your respective FTP server.
  7. After saving the changes, update the adapter by going to the deployments section. You need to do this before any changes are visible to other resources.
Once created, your FTP Connection Factories should look like the following:

FTPAdapterConnectionPool.png


Step 3
The next step is to create the required resources in OSB. In order, create or import the following:
  1. XML Schema
  2. WSDL
  3. JCA Binding
Once created, your project resources folder should look like the following:

OSBResources.png


Step 4
Now we can create our Proxy Service that uses the JCA Transport and the FTP Adapter.
  1. Create a Proxy Service and select the WSDL that you imported in the previous step. As a Proxy Service receives input, the WSDL interface should implement the FTP "Get" operation.
    Note: JCA Transport will only become an available option if your proxy is based on a WSDL.

    FTPProxy001.png


  2. Next on the Transport Configuration page, select JCA Transport and enter in the Endpoint URI. This is the JNDI name that you defined for the FTP Adapter Connection Pool in Step 2. In this case, it's jca://eis/ftp/SampleFtpAdapterr.

    FTPProxy002.png


  3. Now enter the JCA Binding reource you created in Step 3.

    FTPProxy003.png


  4. The advanced properties contain the Activation Spec Properties that defaulted from your FTP Adapter Binding file. Make sure these are still correct for your current deployment. The property "PhysicalDirectory" is the remote FTP location where the files originate from. It is likely that this property needs to be modified. These properties can be changed by un-ticking the flag "Always use configuration from JCA file".

    FTPProxy004.png
You can default the remainder of the Proxy settings. Once the session is activated, the proxy should start consuming from the specified FTP directory.
The configuration of an OSB Business Service is basically the same as above, except for the fact that your WSDL should implement the FTP "Put" operation.
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Oracle Service Bus Best Practices

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today