cancel
Showing results for 
Search instead for 
Did you mean: 

500 Internal Server Error for OData model in sapui5

amber_garg
Active Participant
0 Kudos

Hi All,

I have an odata webservice which is tested successfully on the browser which returns the metadata. However when i use the url to create an Odata model in my ui5 application in eclipse and run it locally from eclipse , it gives me 500 internal server error in console.

One thing to note is that I am using VPN to access the odata url of the gateway server and I am prefixing my URL with proxy


var oMdl_Article = new sap.ui.model.odata.ODataModel("proxy/http/<ip>:<port>/sap/opu/odata/sap/zarticle_viewer_srv/");

When I view the webservice URL in the browser seperately it works fine after asking me username and password

PS: When I upload as BSP to gateway server and remove the proxy/ keyword , the ODATA url returns successfull 200 code. Hence the issue is been faced only while executing this app locally from eclipse for testing,

Message was edited by: Amber .

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Amber,

Did you resolve this issue, if so please can you share how. I am in the exact situation, accessing the gateway server through VPN. The service call is working via direct call in browser but in eclipse its throwing 500 error.

Thanks

shalabh_jain
Employee
Employee
0 Kudos

Hi Amber,


Since, you're able to access the metadata of the service through the browser, it seems VPN is not the issue here.

The best way to troubleshoot the issue is to use a browser based REST client tool like Postman (for Chrome) for issuing a POST call to the service. The client shall ask you for an authorization to access the front end server where your oDATA service is hosted. You may pass the Username and Password in the Service URL (preferably a separate service user ID for security).

Once you're able to make a POST call, you shall be sure that the service is working fine and accessible externally. After this, you may integrate it with your UI code.

Regards,

Shalabh

amber_garg
Active Participant
0 Kudos

Hi Shalabh,

Thanks for your reply. I dont have any POST entity method implemented in my webservice yet but I have tested with GET method .

1) When I execute the WEBSERVICE URL for GET entityset in browser directly , it shows me the xml output in browser successfully with correct data.

2) When I deploy my app from eclipse to sap abap repository (gateway) as bsp and execute from there , the app shows up in browser  with SUCCESSFULL call to ODATA webservice

3) But When I try to test my app locally from eclipse (using localhost) ,I add the prefix "proxy" (as shown in screenshot above),  the ODATA webservice , in this case the odata call shows the500 Server error as given in the screenshot above.

So basically scenario 3 is giving issues

Regards

Amber