cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming REST API via destination service in Neo environment?(avoiding direct Ajax calls)

former_member349501
Discoverer
0 Kudos

Hi All,

I am trying to consume Rest API via destination service in my UI5 application.

But it is giving the following error:

Please find below the steps i followed :

1.Backed system is onPremise system:Hence using cloud connector to establish the connection.

hcp cockpit screenshot.

2.Declared Destination in hana cockpit:

3.Defined destination in neo-app.json file.

{ "path": "/P4MSAPI", "target": { "type": "destination", "name": "P4MSAPI" }, "description": "User Data API" }

4.Defined model and datasource in manifest.json file

"P4MSAPI": { "type": "sap.ui.model.json.JSONModel" }

_______________________________________________________________________________________

"sap.app": { "id": "SampleP4MS.SampleP4MS", "type": "application", "i18n": "i18n/i18n.properties", "applicationVersion": { "version": "1.0.0" }, "title": "{{appTitle}}", "description": "{{appDescription}}", "sourceTemplate": { "id": "servicecatalog.connectivityComponentForManifest", "version": "0.0.0" }, "dataSources": { "P4MSAPI": { "uri": "/P4MSAPI/user", "type": "JSON" } } },

5.Trying to directly bind model(P4MSAPI) in view file.

approach 1:

<Title textAlign="Left" titleStyle="H5" text="{P4MSAPI>/name}">

OR approach 2:

// creates a model and attach it to the view

this.getView().setModel(new JSONModel(), "P4MSAPI");

// do a GET request

this.getModel("P4MSAPI").loadData( "/P4MSAPI/user" );

Please suggest what can be done in such case.

leoirudayam
Advisor
Advisor
0 Kudos

Is the destination URL with "https" also correct, or is it only "http" protocol?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member349501
Discoverer
0 Kudos

Hi All,

Facing 403 error now. Please suggest if any inputs on this issue.

former_member349501
Discoverer
0 Kudos

As per the current destination configuration settings below mentioned additional properties are being used.

WebIDEUsage:api_mgmt_proxy,api_mgmt_catalog,api_mgmt_proxy,odata_abap,dev_abap,ui5_execute_abap,odata_gen

,bsp_execute_abap

WebIDEnabled: True

WebIDESystem : P4MSAPI

Even if we remove WebIDESystem property still the purpose is not getting resolved.

Please suggest if any other additional properties are to be used for working with rest api or json data?

former_member349501
Discoverer
0 Kudos

Hi Leo,

Yes, https is correct .we are using sso secure connection and the status is 200 OK,

connection.jpg

leoirudayam
Advisor
Advisor
0 Kudos

Do you need the additional properties "WebIDESystem" (because this usually defines the <SAP system_ID>)?