SOA : Tutorial - Search Employee

Lets create an employee search service using Oracle SOA.
We will create a service which will take an employee name as input return the employee details as output.
We will use the sample HR schema which is available in the Oracle XE database.


Prerequisites:
1) Unlock the sample HR schema present in the Oracle XE database.
2) Create Database and Application Server Connections in JDeveloper.
3) Create JDBC datasource in weblogic console.



1) Download SearchEmployee.xsd file and save it in a temporary location on your computer.

2) Create a SOA project with the name SearchEmployee



2) Drag and drop 'BPEL Process' on to the Composite.
    Enter a name for the BPEL process and change the Template to 'Synchronous BPEL Process'.
    Click on the browse icon of Input.
 
 -------------------------------------------------------------------------------------------------------

2.1) Click on Import Schema File.
        Browse and select the  SearchEmployee.xsd downloaded in step 1.
       
  -------------------------------------------------------------------------------------------------------

2.2)Select EmployeeSearchInput and click OK.
-------------------------------------------------------------------------------------------------------

2.3) Similarly click on the browse icon of Output and select EmployeeSearchResult.
-------------------------------------------------------------------------------------------------------

2.4) Click OK to Create BPEL Process.


3) We can see the newly created BPEL process in the Components(center) lane in the SOA Composite.
     Right click to edit the BPEL process.



4)  We can see the BPEL process in the editor.
      Drag and drop the Database Adapter between the receive and reply.


------------------------------------------------------------------------------------------------
4.1) Enter the Database Adapter Service Name as search_employee_db
------------------------------------------------------------------------------------------------
4.2)Select the XE db connection and change the JNDI name to eis/DB/hr

------------------------------------------------------------------------------------------------
4.3)For Operation Type select Perform an Operation on a Table and choose only the Select operation.

------------------------------------------------------------------------------------------------
4.4)Import the EMPLOYEES table.

------------------------------------------------------------------------------------------------
4.5)No changes needed in the Relationships and Attribute Filtering
------------------------------------------------------------------------------------------------
4.6)In Selection Criteria add a parameter pEmpName and append the following to the sql query :
       where first_name = #pEmpName and rownum <2


------------------------------------------------------------------------------------------------
4.7)Click next and finish the wizard.
      Click OK to create the DB Adapter.



5) Drag and drop an Invoke activity after receiveInput.
    Rename the Invoke to Invoke_search_employee_db.
    Drag and connect the invoke activity to the Database Adapter(search_employee_db).


------------------------------------------------------------------------------------------------
5.1) Click on the plus icon for Input and Output and create search_InputVariable and search_OutputVariable respectively.


6) Drag and drop an Assign activity after receiveInput.
    Rename the Assign to Assign_search_input.




7) Edit the Assign_search_input and connect EmployeeName under inputVariable on the left to pEmpName under search_InputVariable on the right.





8)  Drag and drop an Assign activity before replyOutput.
    Rename the Assign to get_search_output.





9) Edit the get_search_output and connect the attributes of  Employees under search_OutputVariable on the left to attributes of  EmployeeSearchResult under OutputVariable on the right.





10) Deploy the SOA composite :
      Right-Click the Project and select : Deploy --> SearchEmployee
      In Deployment Action select Deploy to Application Server and click Next.


11) Click Next in the Deploy Configuration



12) Select the application server connection to your SOA server and click next.


13)  Select your SOA server and click finish.


14) You can see if the deployment is successful from the deployment log.




15) To test the composite go to the enterprise manager(weblogic/welcome1) and click the SearchEmployees SOA composite in the home page.




16) Click Test in the composite details page.



17) In the Test Web Service page enter a value for the input field in the request tab and click Test Web Service.



18)  You will see the result in the Response tab.





Below is the video tutorial for creating the same Search Employee example in Oracle SOA.

ADF : Tutorial - Find weather using ADF and SOA

A webservice is exactly what its name says, it is just a service.
It will provide you with a service like for eg: taking a city name as an input and providing you with the corresponding weather details as an output.

You don't have to worry about the underlying implementation of the SOA webservice.
But you do have to worry about what to do with the output of the webservice.
You need to provide a UI for the end user to enter the input parameters and to display the output of the service invocation.

You can use various technologies/frameworks to build a UI on top of a SOA webservice.
ADF is one of them.
Lets see how to build an ADF UI on top of a publicly available webservice.

We will use the Global Weather public webservice.
WSDL : http://www.webservicex.net/globalweather.asmx?WSDL

SOA : Tutorial - Hello World


Lets create the equivalent of the famous Hello World program using Oracle SOA.
We will create a SOA composite which will take a name, prefix it with Hello and return the output.

Prerequisites:
1) You need to Create a SOA project with an empty composite.
2) You need to Create an Application server connection to your SOA server.

Unlock sample HR schema(emp/dept) in oracle db

Oracle database comes with a built in sample schema/user containing the familiar EMP-DEPT tables which can be used for practice.
Previously this used to be under the user/schema SCOTT.
But in the recent releases this has been replaced with the user/schema HR.
To use the HR schema you need to unlock it and reset the password first.
Log in to the database as sys using sqlplus and run the following command to unlock the HR schema.

ALTER USER HR IDENTIFIED BY welcome1 account unlock;

HR schema is now unlocked and its password is set to welcome1.



ADF : Create viewcontroller and model projects in Jdeveloper

One of the first things to do before you can try your hand at developing ADF artifacts is to create an ADF viewcontroller project.
Lets see how to create an ADF viewcontroller project in JDeveloper in a few simple steps.

1) In JDeveloper go to File --> New
2) Select General --> Applications and select Fusion Web Application (ADF) on the right and click OK.


ADF : Create a SOA web service data control

Web services created in SOA can be consumed in a variety of applications.
You can build an ADF ui on top of a web service to display the data in a user friendly way.

The first step for using a SOA web service in an ADF application is to create a web service data control.
The UI can be any thing like ADF UI, ADF mobile UI, Excel spreadsheet etc.
The data control provides access to the underlying SOA web service without exposing any of the implementation details.
The UI layer need not know any of the technical details of the underlying SOA web service.

Lets see how to create a web service data control in ADF.
We will use a publicly available web service for this example.
Lets use the Global Weather web service.


SOA : Create a SOA project in Jdeveloper

One of the first things to do before you can try your hand at developing SOA artifacts is to create a SOA project.
Lets see how to create a SOA project in JDeveloper in a few simple steps.

1) In JDeveloper go to File --> New
2) Select General --> Applications and select SOA Application on the right and click OK.