Skip to Content

How to call php webservice url in SAPUI5?

Aug 17, 2017 at 09:56 AM


avatar image

I had tried various methods for this but i didn't get this one, can anyone give proper solution for this? Actually, I know how to call web service by using ajax calls, but whenever I tried to pass my url as below, it gives me error,

onInit: function() {



type: "POST",


accepts:{ text:"application/json" },

success: function(oResData){

if(!oResData) {"No Success"); }

else{" Success"); } },

error: function(){"unsuccessful json call"); } });

var oModel=new sap.ui.model.json.JSONModel();

sap.ui.getCore().setModel(oModel); }

The above code gives me error:

error: Fiori Architectural guidelines: ESLint(sap-no-hardcoded-url): Hardcoded (non relative) url found.

Kindly suggest me.....

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Jamie Cawley
Aug 17, 2017 at 11:57 AM

The error is related to the lint settings. I believe if you build the url it will not catch it

var url = "http://" + "SERVER_IP" + "/SAP_DEMO/register.php";

but you should really be using a destination and a neo-app entry to access the resource.

You could also turn the lint settings off in the project settings -> code checking -> javascript. Disable sap-no-hardcoded-url



Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thanks Jamie for your reply. But I didn't get what you explained. Can you please ellaborate?