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