Showing posts with label REST Service. Show all posts
Showing posts with label REST Service. Show all posts

Tuesday, 17 July 2018

Certificate error while invoking REST adapter in Oracle SOA 12c

You might get into certificate error (valid certificate path not found) while invoking a rest service through rest adapter in Oracle SOA even though you install the certificates using keytool.
To overcome this issue, 
  • Login to EM console
  • Navigate to weblogic Domain --> Security --> Keystore
  • Select the System (row) --> select trust 
  • Click on Manage
  • Import the root certificate
  • Restart the server and it should work.

Wednesday, 6 January 2016

Invoking a REST service in Oracle BPM/PCS webform

One of the common requirement in oracle BPM/PCS webforms is to populate the dropdowns by calling a REST service. Below java script code shows populating the dropdown values by calling the REST service.

This code assumes the rest service returns list of items which is name/value pair.
/*member count, items*/
/*member id */
var x;
if (form.load)
{

   Status.value = 'No errors';
   try {
      var uri = "REST_SERVICE_URL";
      eval('x=' + http.get(uri));

      }  catch (e) {
        Status.value = 'got exception' + e ;
   }
   var lovArray = [];
   for (var i=0; i< x.items.length; i++)
   {
      lovArray[i]=x.items[i].name;

   }

   DepartmentsList.options = lovArray;

}

This code assumes the rest service returns just list of values which needs to be displayed in dropdown

/* member items, id */
if(DepartmentsList.value.length>0)
{
  
  try {

      var uri = 'REST_SERVICE_URL;
      eval('x=' + http.get(uri));

      }  catch (e) {
        Status.value =  uri + e;
   }
   approverList.options =x;

}