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 :)  









No comments:

Post a Comment