Wednesday, 13 December 2017

Creating Restful Service from Soa Suite 11g

Hello All,

I had got an assignment to create a rest enabled soa composite where we need to pass any input and we must get a response.

Rest service are widely used for mobile integrations. Since it is light and used over http.

So with the above requirement I have taken usecase as:
Creating a RESTful webservice which has to concatenate users input to a string Welcome.                          
Ex: users i/p à team India   expected o/p à Welcome team India

STEPS:

1. Create SOA Application

2. Create SOA Project

3. Create Empty Composite

4. Create XSD according to requirement

5. Under exposed service drop a HTTP binding adapter ( since we do not find any REST adapter in 11g)

6. Configure HTTP Adapter:






7. Composite will look like this



7. Create BPEL ( define service later )


8. Composite now look like below:


9. Wire the BPEL to the exposed service


10. Open .bpel and add recieve, reply and configure them



11. Receive activity:


Composite look so far :


12. Reply activity:


13. Add assign activity in between recieve and reply and edit: concat('Welcome',' ',recieve input')



14. Save all

15. Configure OWSM policy for http_client exposed service shown in previous post OWSM policy configuration
16. Deploy to the running application server

TESTING:

1. Open deployed composite. Open your wsdl

2. Attach policy to your composite policy configuration

3. This opens the wsdl ( If it does not open with the direct link, replace host name in the URI )

4.  Remove ?WSDL from the above URL and run

To:

5. This opens up a page: Enter your input and click on Invoke REST get


6. There you go! the response page opens with desired output




We can now see the response message as “Welcome” concatenated with the users input.
Our use case scenario is successfully working.


Keep exploring REST!

Lets explore SOA! 

Cheers to the next- krithika :)  









Wednesday, 6 December 2017

Adding OWSM Policies to services ( em & jdev)

Hi,

Many a times it is necessary for us to secure our exposed services/components/external reference with one or more predefined owsm policies.

Here I am demonstrating the same for a exposed rest service.

Example: I have a REST service and I am supposed to add "oracle/multi_token_rest_acces_service_policy"

Steps: Adding policy from EM: 
1. Go to EM Console
2. Go to your deployed composite
3. Policies Tab


4. Click on AttachTo,DetachFrom drop Down and choose service where policy have to be added.


5. This opens up a window with available policies, Choose appropriate and click on attach 


6. This moves the chosen policy to the upper shelf of  "Directly attached policy" ( if you dont want attached policies then click on detach, marked in red)


7. Thats it policy gets attached to our service.


Steps to Configure the same policy for the same service from JDEV:

1. Go to your Jdeveloper, open your composite.xml
2. Choose your service for which you want to configure policies ( here exposed rest service )
3. Right Click on the exposed service 
4. Select Configure WS Policies
5. This opens a window and choose appropriate policy under security tab

6. Once selected below it gets checked, it means it gets added to the service.


7. Go to source of composite.xml and edit the policy name to the exact policy that we attached in the em console for http_client_service
"oracle/multi_token_rest_access_service_policy"



7. Thats all! We can see our exposed service is now Configured with the appropriate policy.


Other general policies that we add:
oracle/wss_username_token_service_policy

Keep exploring owsm policies... 

Cheers! to the next ..
Krithika 








Thursday, 23 November 2017

Using Preferance Variables in SOA composites

Hi,

Oracle SOA suite has provided the facility to add preferences in your composite process.
These preferences are worked as variables which we can change at runtime from EM console.

Ex: We can use preference variable when we need to define which environment we are working in, preference variables for certain values which do not want to hard code, for certain usernames which are unaware for some other components while invoke our service etc.

So each time there is no need to go to our composite and change the value manually and then redeploy and test.
Instead we can define preference variables and change its values in run time from em console.

Steps to create preference variable:
1. Go to your composite.xml and under implementation.bpel define the property:


like ex2: <property name="bpel.preference.EnvName">DEV</property>

2. Go to your .bpel and use this preference variable.

Here I am mapping my output variable to num1 x  num2 which are defined as pref variables.

3. Deploy and test your multiplication service:

We are now able to see the multiplied value of num1 and num2 .

4. Now if you want to change the value of the fields then we can directly follow this path:

Right click on SOA-Infra –> Administration –> System MBean Browser


under System Mbean Browser follow the below navigation:

oracle.soa.config–>soa_server -->SCAComposite–>(yourCompositeName) ->
SCAcomponent.SCAComposite

This opens up a table, in that

Click on the properties tab and expand properties tab to find out element that contains your defined preference variable.

Here we can change the value field to any.

So after changing its value and click “Apply”.


So thats all! 
We can now test with different inputs to defined preference variable from em.

Keep exploring SOA! :) 
Cheers - Krithika G

Monday, 20 November 2017

Converting Synchronous bpel process to asynchronous

Hi,

This is aslo little tricky, where we cannot just delete reply activity from .bpel to make it asynchronous process.

To make the developed synchronous bpel process to asynchronous we need to make changes in .bpel and .wsdl files generated.

Steps: {Marked in RED are the changes to be carried out.}

1. In .bpel File:

    a) In Partner link tag we need to add partner role

<partnerLink name="multiplicationprocess_client" partnerLinkType="client:MultiplicationProcess" myRole="MultiplicationProcessProvider" partnerRole="MultiplicationProcessRequestor"/>

    b) In Recieve tag change operation from Process to Initiate

<receive name="receiveInput" partnerLink="multiplicationprocess_client" portType="client:MultiplicationProcess" operation="Initiate" variable="inputVariable" createInstance="yes"/>

    c) In Reply activity
we have: <reply name="replyOutput" partnerLink="multiplicationprocess_client" portType="client:MultiplicationProcess" operation="process" variable="outputVariable"/>

Do the following Changes:

<Invokename="callbackClient" partnerLink="multiplicationprocess_client" portType="client:MultiplicationProcessCallback" operation="onResult" variable="outputVariable"/>

2. In .wsdl file

    a) Port type
For synchronous we have  Port type defined as below:
<wsdl:portType name="MultiplicationProcess">
<wsdl:operation name="process">
<wsdl:input  message="client:MultiplicationProcessRequestMessage" />
<wsdl:output message="client:MultiplicationProcessResponseMessage"/>
</wsdl:operation>
</wsdl:portType>

Copy paste it twice and do the required changes, and we can comment or delete the sync port typ tag defined above.

<wsdl:portType name="MultiplicationProcess">
<wsdl:operation name="Initiate">
<wsdl:input  message="client:MultiplicationProcessRequestMessage" />
<!--<wsdl:output message="client:MultiplicationProcessResponseMessage"/>-->
</wsdl:operation>

</wsdl:portType>
        <wsdl:portType name="MultiplicationProcessCallback">
<wsdl:operation name="onResult">
<wsdl:input  message="client:MultiplicationProcessRequestMessage" />
<!--<wsdl:output message="client:MultiplicationProcessResponseMessage"/>-->
</wsdl:operation>
(Delete or comment wsdl:output message)

    b) In PartnerLink
For sync we have:
<plnk:partnerLinkType name="MultiplicationProcess">
<plnk:role name="MultiplicationProcessProvider">
<plnk:portType name="client:MultiplicationProcess"/>
</plnk:role>
</plnk:partnerLinkType>

For async we need to add one more role and port type within partnerlink definition:
<plnk:partnerLinkType name="MultiplicationProcess">
<plnk:role name="MultiplicationProcessProvider">
<plnk:portType name="client:MultiplicationProcess"/>
</plnk:role>
                <plnk:role name="MultiplicationProcessRequestor">
<plnk:portType name="client:MultiplicationProcessCallback"/>
</plnk:role>
</plnk:partnerLinkType>

Thats it! now synchronous becomes Asynchronous process.

Let's explore SOA


Challenging task: Changing Soa Suite Project Name and Composite name after deployment

Hi All,

Had faced this difficulty to change Project name after the composite is deployed in server.

Below are the steps to do it in ease:

1. On Jdev select your project then click on the upper menu File -> Rename
2. On the Rename screen change the .jpr name on the File name field then OK
3. Now that only changes the name of the project,
4. Now you have to change the name of your composite, to do that open your composite.xml file Click on the Source tab
5. On the <composite/> tag change the name attribute to your new project name and save it
6. We will have to create a new deployment profile too, to do that right click on your project then select Project Properties -->Select Deployment -->Delete the deployment profile that has your old project name.
7. Click on the New button
8. On the Archive type select the SOA-SAR File
9. Type a name for your new profile an click OK.

That´s all!
Close the application and re open it again, we should now be able to see renamed project name and composite name!

Let's explore SOA!


Wednesday, 8 November 2017

DB Adapter - Poll for new/changed records Settings (Limit rows)

Hi,

Database adapter is used to poll/retrieve diferent kind of records from datatbase.

Consider a case:
 We are polling a table, which is rapidly updated by another process. 
 So now every polling cycle , the eligible records for the DB poller , will be huge in number.

And in cases where the data retrieved is metadeta related to some other information like Batch id or OrderId , which are used to retrieve more information , then the server will not be able to handle such amount of data, even in case it handles there will be a huge performance impact.

How to restrict this kind of behaviour ?

During configuring our DB poller, we have few performance parameteres:



  1. Database rows per XML document
  2. Database rows per Transaction 
If we want to pick only 10 rows at a time i.e., only 10 rows per one instance , then we need to give the value 10 for the property called "database rows per XML document"

This creates an xml with 10 elements and is passed through a single Oracle BPEL Process Manager instance.

Assume that there are 100 rows at the start of a polling interval and that "Database rows per Transaction" is 10. 
In standalone mode, a cursor is used to iteratively read and process 10 rows at a time until all 100 have been processed, dividing the work into 100 / 10 = 10 sequential transactional units. 

Note: "Database rows per Transaction" value must be equal or greater than "database rows per XML document"

Example:
lets say 100 records to process in DB.
"database rows per XML document" as 10
"database rows per transaction" as 20
This is how it behaves at runtime:
First the database adapter gets 20 rows from database and now 2 instances will be created with 10 records in each.

then the next 20 records will be retrieved and creates 2 instances with 10 records each....
and this process continues until all records are processed with the appropriate read value.



Hope the concept has clarity!

Let's explore SOA!
Krithika g



Tuesday, 7 November 2017

Installing Oracle SOA Suite 12c - windows 64bit system

With the new feature of 12c, we have a single

Steps:

* Downlaod Jdk 8 or above version 
  (we need to download supported JDK, you will not be able to run Oracle SOA 12c installer if        we don’t have supported JDK)

You can download latest jdk from: https://edelivery.oracle.com - serach for releases - jdk - ver 

* Save JDK in C:/Java
* Download below files from Oracle downloads: 
  • fmw_12.1.3.0.0_soa_quickstart
  • fmw_12.1.3.0.0_soa_quickstart2
* Extract 2 folders of Oracle soa suite 12c and save it in C:\12c\fmw_12.2.1.0.0_soa
* Run CMD as administrator

* We need to go to java bin folder where you have installed latest JDK in cmd
   ( C:\sys32>cd {Path of jdk\bin} )

   C:\Windows\system32>cd C:\Java\jdk1.8.0_121\bin

*Oracle SOA 12c is an executable jar file so we need to run it from command prompt in the next line, we need to provide extracted jar file name 
(C:sys32>jdk bin>java.exe -jar {path of executable jar file}\execuatble jarfile name )

C:\Java\jdk1.8.0_121\bin> java.exe -jar C:\12c\fmw_12.2.1.0.0_soa\fmw_12.2.1.0.0_
soa_quickstart.jar


With this installation takes progess:

Provide a proper path for Oracle Home

Installation takes little time once 100% click on Finish

Oracle jdeveloper Jdev12c opens up after this last step.

Thanks! keep exploring Soa! 
Krithika G



Monday, 6 November 2017

Creating file Based MDS SOA connection in JDev 12c

As we know MDS is used to store artifacts like WSDL, XSD, XSLT etc.
For example, if a two SOA application uses a common WSDL, then we simply place the file in the MDS repository
We have two types of MDS - File based MDS and DB based MDS.

In Oracle SOA 12c, when we use default server which is integrated with Jdeveloper then we can use only Design Time MDS (File Based MDS), Run Time MDS (DB Based MDS) is not supported.

Usually, File-based is used for the development environment and Database-based  is used for the production environment.

The MDS repository (File/DB) must be registered in the WL server before deploying an application that uses the MDS repository.

Steps to create File based MDS in JDev 12c:

1. Click on resource pallete to create new MDS connection
    New IDE Connections --> SOA MDS
2. Wizard opens:
    Fill in the details such as : connection Name (any)
                                               connection Type ( file based MDS)
                                               MDS root folder ( give physical local location )
3. Test the connection. Status should be 'sucess'.
4. Click 'ok' and then we can see the File based MDS created on the right side under IDE connections     tab.











Wednesday, 6 September 2017

Creating New user for WorklistApp from console

Hi,

This is a fresh post after many days! Got some time to write. :)

In this we will try to see how we are creating new user to access Worklist app.

"http://hostname:portnumber/integration/worklistapp"

Use Case: 
When we require human intervenation in our business requirement, then we are supposed to use Human task activity in our composite to handle few actions like ( approve, reject, to amke a comment) in the process flow.

So we need to create some users and groups to take up the task.

Say now we are creating User named: Lead , he who now take up on required action on the human task request in worklistapp.

Now we wil see how to create the New User from Console.

Steps:

1. Login to console
2. Click on Security Realms on left hand side bar.

3. This pops up a wizard- click on "myrealm"

4. Users and Groups

5. Click New


6.Fill in the details of user and give password of length=>8

7. Yes We have created the user succesfully, and the same gets reflected under user list.



There we go! Done with the creation of new user!

Let's Explore SOA!

- Krithika G