Skip to Content
1
Feb 27, 2017 at 09:06 PM

How to get HCP WebIDE invoke an MDC OData service

434 Views Last edit May 27, 2020 at 07:41 AM 2 rev

I am developing an SAPUI5 template Master Detail application with the HCP webIDE. I have a HANA multi-tenant database MDC through my trial account. I have a sample SAPUI5 application I have developed using the webIDE within the MDC that invokes the OData services no problem. The webIDE within the MDC does not have the nice templates and graphical editor. I would like to develop the application using the HCP webIDE templates since they have the WYSIWYG capabilities with the graphical editor.

I created an HCP destination to my OData service but even though the test connection works with the basic authentication credentials, I am not able to pull up the entities during the design time template HCP SAPUI5 template wizard screens. So I read through several discussions and saw a recommendation to create an EDMX file based on the OData metadata and instead point to this during the wizard. I did that and my SAPUI5 template generated app works in App in FLP Sandbox mode. I was also able to export this app into my MDC content repository and then adjust the neo-app.json and manifest.json files to point to the OData service and change the reference to the SAP Javascript libraries to get this to work. But this is really tedious if I want to continue developing on the SAPUI5 app in the HCP WebIDE.

Is there a simple way to have the HCP WebIDE actually integrate to the MDC OData service without having to implement a workaround NodeJS or other proxy approach? I have read the article - "CORS Issue while consuming Hana's OData" https://archive.sap.com/discussions/thread/3477205. Can't I simply add the CORS configuration through the XS admin tool to enable Basic Authentication and the HTTP methods? I am able to invoke the OData service through the Chrome console but am running into the error: XMLHttpRequest cannot load https://XXXXXXXXtrial.hanatrial.ondemand.com/XXXX/XXXXXX/XXXXX/WebContent/XXXXX/XXXXXXOData.xsodata/$metadata. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://webidetestingXXXXXX-XXXXXXtrial.dispatcher.hanatrial.ondemand.com' is therefore not allowed access.

The workaround approach articles were written a while back - so I am wondering if SAP has a simpler solution by now.

Thanks for any help in advance.

Jay

Attachments

cors-setup.jpg (76.4 kB)