Skip to Content
0
Former Member
May 12, 2016 at 11:01 AM

Error while calling a OData Gateway Service in SAPUI5

590 Views

Hello Experts,

We are working on consuming a OData Gateway service in SAPUI5 and have roadblocks while achieving it.

Firstly, we created a service in SEGW in the Gateway system, and mapped it to a custom RFC. We generated the classes, but we are facing an issue with registering the service. When we click on 'Register' under 'Service Maintenance', the 'Registration Status' is not updated to green. Moreover, when we try to 'Maintain' the service, we get a message, 'Service not registered in the system'. We have followed the (Quick Starter Configuration Guide - SAP Gateway) and everything seems to be in place. However, we are unable to register the service or figure what is missing here. Request your expertise on this.

Hereafter, we tried calling this service from UI5. We used the following code for calling the service:

var oModel = new sap.ui.model.odata.ODataModel("<domain_name>:<port_no>/sap/opu/odata/sap/ZTEST_EMAIL_SRV", false, "<UID>", "<PWD>");

Please note, here the actual values are replaced by placeholders (angular brackets).

However, we are getting an error: 404: Method Not Found error or 401: (Unauthorized) error. We went through the configuration several times and even tried consuming a standard service, but we still get the same error. Are we missing any configuration here? Or could it be since we are unable to register the service???

Request your expert advise to get a resolution to this.

Thanks in advance!!!

Regards,

Divyata Dal