-1

Thanks a lot to all of you, my friends for your help and advices. Guys, I think I solved the problem, almost. Just need your help with this moment: My Table get data from mock server, but doesn't show it to user. Instead of the rows it shows an empty table where the rows count is equal to the data in my mockserver file. I mean: At the moment, in "ZMA_BPSet" there'se 8 rows. Because of this you can see 8 rows in table. Can anybody help me?

Project Run!

dkolodin
  • 23
  • 7

1 Answers1

0

rootUri is used to determine the path of the OData service that should by intercepted by the mock server. It should always correspond to the service uri of your OData service specified in manifest.json.

So, if you have this in your manifest

"dataSources": {
    "mainService": {
        "uri": "/sap/opu/odata/your-service/",
        "type": "OData",
        "settings": {
            "localUri": "localService/metadata.xml"
        }
    }
},

your mock server constructor should look like this:

var oMockServer = new MockServer({
    rootUri: "/sap/opu/odata/your-service/"
});

Note that the rootUri must always have a trailing slash. If your service url in manifest.json does not have one, make sure that rootUri does.

You don't have to change anything in your manifest.json. All test setups are done in mockServer.html and its referenced files.

Carsten
  • 905
  • 6
  • 7
  • Thanks a lot, for your answer, corschdi. If I don't have any OData service, something like Northwind, but I have my own service which not working now. What should I do in this case? – dkolodin May 27 '19 at 08:05
  • If your service is not available yet, you can specify any uri you want, as long as they match in manifest and rootUri. The default app (`index.html`) will not work, but your mock server setup (`mockserver.html`) will work fine with your mock data. – Carsten May 27 '19 at 10:24
  • You might want to edit your original question if you want to share code. You can't post code inside comments. – Carsten May 27 '19 at 12:08
  • Can you also share your `localService/metadata.xml`? – Carsten May 27 '19 at 12:51
  • Indeed, I missed that `preload: true` has to be `preload: false` in `manifest.json`. Otherwise, the requests will start before the mock server is ready. I hope this resolves your issue. – Carsten May 28 '19 at 07:41