Using File Adapter, Database Adapter and Mediator component in SOA 11g

For Below example i have created below schema definition file. You can save the below file as customer.xsd


<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.example.org"
            targetNamespace="http://www.example.org"
            elementFormDefault="qualified">
  <xsd:element name="CustomerInfo">
    <xsd:annotation>
      <xsd:documentation>
        A sample element
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="CustId" type="xsd:int"/>
        <xsd:element name="FirstName" type="xsd:string"/>
        <xsd:element name="LastName" type="xsd:string"/>
        <xsd:element name="Email" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>



Create an application and new project

DB_Adapter-1-1.JPG

 

Click Ok

DB_Adapter-1-2.JPG

Give Application Name and Click Next

 

DB_Adapter-1-3.JPG

 

Give Project Name and click Next

 

DB_Adapter-1-4.JPG

Select Composite with Mediator and click on Finish.

After clicking on Finish Create Mediator window opens up

 

DB_Adapter-1-5.JPG

Name :         RouteCustomer

Template:  Define Interface Later

Click on OK

 

DB_Adapter-1-6.JPG

 Drag a file adapter from service components to Exposed services as shown below

 

DB_Adapter-1-7.JPG

Press Next

 

DB_Adapter-1-8.JPG

 

Give Service Name as ReadCustomer and click Next.

DB_Adapter-1-9.JPG

Click Next

DB_Adapter-1-10.JPG

Click Next

DB_Adapter-1-11.JPG

Give the directory where the input file will be coming and specify archive directory if needed.

Click Next.

DB_Adapter-1-12.JPG

Give the name pattern for input file and click on Next à Next

 

DB_Adapter-1-13.JPG

Click on Browse button next to URL to select Customer.xsd as schema definition file and click on Next.

 

DB_Adapter-1-14.JPG

 

Click on finish.

 

DB_Adapter-1-15.JPG

 

Now Drag a Database adapter to external references that is going insert the data to CUSTOMER table.

 

DB_Adapter-1-16.JPG

Click Next on Welcome Screen

 

DB_Adapter-1-17.JPG

Give name as InsertCustomer and click on Next.

 

DB_Adapter-1-18.JPG

 

Select Database Connection and click next.

 

DB_Adapter-1-19.JPG

 

Select Perform an operation on a table - Insert only and click Next.

Click on Import tables and select customer table as shown below.

 

DB_Adapter-1-20.JPG

Click Nextà Next

 

DB_Adapter-1-21.JPG

Check the attributes that are part of insert statement and click next à Next and finish.

 

DB_Adapter-1-22.JPG

 

Now wire each of them as show below.

 

DB_Adapter-1-24.JPG

Now Double click on RouteCustomer.

 

In RouteCustomer.mplan window click on select an existing mapper file or create a new one under static routing as shown below.

 

DB_Adapter-1-25.JPG

 

DB_Adapter-1-26.JPG

Click on Create New Mapper File and click Ok

 

DB_Adapter-1-27.JPG

In CustomerInfo_To_CustomerCollection.xsl

Drag CustomerInfo from sources and drop to customer in target.

 

DB_Adapter-1-28.JPG

Click Ok

 

DB_Adapter-1-29.JPG

 

Close both xsl file and mplan file.

Now deploy the composite by right click on project àDeploy àForumsPrj

 

DB_Adapter-1-30.JPG

Click Next


DB_Adapter-1-31.JPG

Click Next

 

DB_Adapter-1-32.JPG

 

Click Next

DB_Adapter-1-33.JPG
click finish to complete the deployment.

Thanks
AJ
Comments:

It is too good for beginers.Can u please send me one more example on DataBaseAdapters with Stored Procedures and Functions.

Posted by Viswas Kumar on October 03, 2011 at 07:47 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

bocadmin_ww

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