cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 Mock Server does not work

bbalci
Contributor
0 Kudos

I'm trying to setup Mock Server and use local JSON files as sample data on my new empty UI5 application, I've done the following steps but Mock data is not returning. Can someone tell me what am I doing wrong ?

Steps :

  • I've downloaded this example project from Demo Kit :Sample: OData V2 Mock Server - Step 2 - Creating a Mock Server to Simulate Data and installed on my local WebIDE , it worked successfully.
  • To use Mock Server on my own application , I've copied "localServices" and "test" folders to my own application :


    Normally "index.html" uses "component.js" file to bootstrap the application. But for testing , the application should start by calling this "mockServer.html" file instead of "index.html" as in the example from Demo Kit.
    So, to change the start page to the mockServer.html file, I've opened the Project Settings > Annotation Modeler > Run Configurations and created a new Run Configuration.

  • In mockServer.html file, I've modified the paths according to my project name , so it can address the "/test/initMockServer.js" file which I've copied from example application. (My project name was "mocktest" and namespace was "TRAINING" .. it's just an empty application )

  • After all of it, I start the application and I'm able to see in Chrome debugger that "mockserver.js" has been called and "oMockServer" object is created with mockdata array attribute coming from JSON file as below :

  • Everything seems okay until now, to check the Mock Server is responding , I just put a List component on the main view of the app .. as in the example as in demo kit which sends a /Meetups request as below :

No data is returning.
Do you see anything wrong ? Is there anyway I can test the Mock Server in this UI5 application on Chrome's debugger by console or watch features ?

Thanks in advance

P.S. I've already upgraded my UI5 version to 1.107.1

View Entire Topic
fabio_ubbiali
Explorer

Hi Bulent,

did you enter the default oData Model in manifest.json?

Fabio

bbalci
Contributor

Thanks Fabio !