For partners that build or integrate commercially available applications and service solutions with the Oracle Cloud Platform
For partners that provide implementation or managed services around Oracle Cloud Applications
Hello we have the following tools to work with.
1: Database as a Schema service
2: Visual Builder Cloud service
We're trying to do the following.
Deploy a restful webservice created by the wizard available in APEX , deploy it , consume that as a business object in Oracle Visual Builder Cloud service.
So we can build an app around this object. In an older post it was explained to me that for these restful webservices created in apex (ORDS) we need to create a Business Object Providers to consume
such services. I've attached the code that we edited based on the link provided before as a reference point https://blogs.oracle.com/shay/getting-data-from-rest-services-into-oracle-application-builder-cloud-service
We can see that the webservice is called but no data is showing up in the Visual builder cloud service. We can get the data when we call the webservice in our browser and in apps such as SOAPUI etc.
I've attached some screenshots and also the sample code files. Can you help?
Have a sample table test_state
we've deployed this table as a rest service from the Database as a schema service Apex console.
We tried accessing the data using the steps shown below but it doesn't bring up anything.
Comment
You'll need to modify your operation provider to drill into the "items" array.
It should end up looking something like this:
----
define([
'bop/js/api/operation/BOPAuthenticators',
'bop/js/api/operation/OperationBuilder',
'bop/js/api/resource/Resource',
'operation/js/api/Operation',
'operation/js/api/OperationResult'
], function (
BOPAuthenticators,
OperationBuilder,
Resource,
Operation,
OperationResult
) {
'use strict';
var RESTOperationProvider = function (dependencies) {
var self = this;
this._operations = [];
this._resources = [];
this._baseUri = "https://yourapexserver/acdev/health2/getTopTen";
// Check to see if entity is registerd, and if so provide a simple
// read operation for a list of entities
var userEntity = Abcs.Entities().findById(RESTOperationProvider.USER_ENTITY_ID);
if (userEntity) {
this._operations.push(new OperationBuilder({
name: 'Fetch all users',
type: Operation.Type.READ_MANY,
performs: function (operationData) {
var ajaxObj = {
method: 'GET',
url: self._baseUri,
dataType: 'json'
};
return new Promise(function (fulfil, reject) {
self.getAuthenticator().invoke( ajaxObj ).then(function (response) {
var arr = RESTOperationProvider._parseDetails(response);
return fulfil(OperationResult.success(arr));
});
});
}
}).description('Fetch all users from the jsonplaceholder users resource')
.returns(userEntity)
.build());
RESTOperationProvider._parseDetails = function (response) {
var res = [];
var data = response.getData();
data.items.forEach(function(items) {
res.push(items);
});
return res;
};
// Generate the resource model required to configure the security model
//
this._resources.push(
Resource.create({
id: '1',
template: self._baseUri,
entity: RESTOperationProvider.USER_ENTITY_ID
})
);
}
// Create an instance of authenticator
this._authenticator = BOPAuthenticators.getDefault(dependencies, {
getResources: function( ) {
return self._resources;
}
});
};
RESTOperationProvider.USER_ENTITY_ID = 'com.users.user';
RESTOperationProvider.prototype.getOperations = function () {
return this._operations;
};
RESTOperationProvider.prototype.getAuthenticator = function () {
return this._authenticator;
};
return RESTOperationProvider;
});
----
Average Rating:



1 rating
|
Sign in to rate this
Thanks Shay
We ended up doing something similar and it worked ...
Really appreciate your help ...thanks
D
Average Rating:



1 rating
|
Sign in to rate this