Tuesday, September 23, 2014

We discussed about REST services and also saw how to create REST services in SOA 12c in previous post. Click here to read that post, if you didn’t read that already. As we saw in that post, WADL file gets generated when we deploy REST service to server and we use that WADL file to test that REST service.

In this post, we will see how to invoke REST service from SOA composite in 12c. To invoke the REST service we use the WADL file of REST service. In earlier version of SOA we use HTTP bindings to invoke REST service but in this version we use REST bindings to invoke REST services. REST bindings also provide JSON support in this version.

We have created a sample composite and added a BPEL to it. We will add reference to the composite to invoke REST service. To add reference to composite file, drag REST bindings which you can find under component palette. REST binding was not part of SOA 11g, this is newly introduced in SOA 12c. Once you drag the REST binding to composite file, it opens another wizard where we fill required information to add REST service reference. 

Provide REST service reference name and make sure type is selected as Reference in drop down list. Now we will add required operation of REST service and we will use WADL file for that. To do that click on green plus button in Operation Bindings section and choose “Add operation based on WADL service”.

Add REST Binding

Once you click on above option, it opens another wizard window where we need to choose the REST service WADL file. Click on Application server and choose WADL file under SOA folder. We choose the integrated Weblogic server as we use this server, you can choose standalone server if you are using that server.

Select WADL file

Once you choose the WADL file, you can see all the required information like resource path, operation, http verb gets filled automatically in create REST binding wizard. Click on ok, then it ask to maintain local copy of the files, check all checkboxes and click ok. This will add required REST service reference to your composite, now wire the REST reference to BPEL process, your final composite should look like below.

Invoke REST Service

REST Service

Now compile this service and deploy it to the server. Now we either test this service from HTTP analyzer or from EM console. To test it from HTTP analyzer, go to application server connection and choose Integrated Weblogic server connection, expand till SOA folder and go to above deployed service WSDL file , right click on that and test it. This opens HTTP analyzer window where we can provide required input and see the response.

To test it from EM console, go to EM console and in the left pane, open the above deployed composite and click on test. Fill request parameters and test the service. You can see success response in response tab. Open the instance and see the flow, in the flow you can that BPEL successfully invoked the REST service.

Invoke REST Service Testing


  1. I tried to invoke simple REST service the way you mentioned in Oracle SOA . I keep getting:
    "unsupported variable inputVariable in REST invoke" as fault. Would you please mind to attach your sample application?

    1. Were you able to find a solution to this?

  2. Can we invoke external REST services or only SOA Rest services

    1. Yes. You can invoke external REST services too

  3. This is useful. Thanks. But how is the BPEL constructed? How is the creation of variables for the service made? The assign? I'm trying to call a REST Services with a POST operation and a x-www-form-urlencoded content type for the request and get the "unsupported variable" message as well. Can you share a little more detail on the BPEL and how you call your REST service, please?

    1. Were you able to do this? I am also struggling with the same.

  4. Hi Vivek,

    Could you please let me know how to set the configurations for rest reference in the composite configuration plan? will the endPointURI property will work for rest or only the location attribute value? by default the rest reference is showing as empty whenexposed the config plan from composite. with only location attribute value it is working and it will not shown in the em console with project references. please advice.