In my previous post we saw how to create a REST service using SOA Suite 220.127.116.11.0.
To view my previous post ClickHere
To invoke REST services we will use WADL file of the REST service. In our previous version of SOA Suite we use the HTTP bindings to invoke the REST service but in SOA Suite 12c we have REST binding to invoke the REST services.
We have created a composite with a BPEL process .Now we will add reference to the composite to invoke REST service.
To add reference to composite file, drag REST bindings from component palette.
Provide the name and select the checkbox “Reference will be invoked by components using wsdl interfaces” and click on Next.
In resources window click on + button of “configuration shortcut” and select the “Add resources and operation mappings based on WADL service”.
It will open the WADL chooser window , select the WADL file it will automatically fill all the columns like operation, resource path, http verb and complete.
Now click on Finish , it will ask you you to have the local copy of all files, select all check boxes and click on OK.
Now wire the BPEL process with REST reference. And your composite looks like this.
Now inside the BPEL process add a invoke activity to invoke the REST service and assign input to it .
compile this service and deploy it to the server. Now we will either test this service from HTTP analyzer or from EM console
Test it from EM console, open the deployed composite and click on test. Provide input and test the service. You can see success response in response tab. If we open the instance we will find the new service successfully invoked the REST service and got the response.