cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming Gateway service using OData model in Eclipse

Former Member
0 Kudos

Hi All,

I have been trying to implement the example given in this blog: http://scn.sap.com/community/developer-center/front-end/blog/2012/09/06/how-to-consume-sales-oder-ga... 

But when I run it, no data is displayed in the table. I'm using Eclipse Kepler with SAPUI5 toolkit and I run it in HANA Cloud Platform SDK local runtime in Chrome browser. What might be the problem in this?

Will I be able to consume the sample services given in in my application?

Any documents or examples on this would help.

Thanks in Advance,

Swetha

Accepted Solutions (0)

Answers (1)

Answers (1)

CarlosRoggan
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Swetha,

have you tried to check what's actually happening when running the UI5 app?

In Chrome, press Ctrl + Shift + I  (opens the Developer Tools)

Activate the "Network" Tab

Then run the app again and check the HTTP requests and responses.

There are probably error codes and some useful information in the error responses.

This might help you in further investigation.

Don't give up 😉

Cheers,

Carlos

Former Member
0 Kudos

Hi Carlos,

Sorry for the late reply. The same issue has been addressed in this thread. http://scn.sap.com/thread/3202242 I tried as given in it, but still I'm not getting the desired output!

I'm still getting the following error.

Thanks & Regards,

Swetha

CarlosRoggan
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Swetha,

the console shows that a wrong URL is being invoked:

xxxx/<servicename>/<entityset>/$metadata

this is obviously wrong

correct would be:
xxxx/<servicename>/$metadata

I don't know the tutorial and the thread mentioned by you, but maybe you have a typo in your code, such that the service-URL contains the entityset.

I would assume that you can remove the token SalesOrders/ from the URL, somewhere in your code, such that at the end the URL would be:

.../opu/odata/sap/ZCD204_EPM_DEMO_SRV/$metadata

Hope it helps,

Cheers,

Carlos

Former Member
0 Kudos

Hi Carlos,

Thanks for your reply.

I tried as you mentioned. It doesn't give any error but the output is also not displayed. When I run it in Chrome it asked for username and password. The following is displayed:

Not sure what might be the problem.

Thanks & Regards,

Swetha

CarlosRoggan
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Swetha,

fromthe console output, we cannot see what URL is being called in order to populate the list.

You could try to switch to the "Network" tab. There you'll see all calls that are being done to fetch UI elements, etc. One of the calls should be an OData call, probably invoking the SalesOrder collection.

You could verify this.

If the URL is correct, you could furthermore verify if data is returned by opening the URL in a "normal" browser window (using right click) and check if data is delivered, or if the reason is simply that the collection is empty.

Just some hints for further investigation.

I'm afraid I cannot help you  further, as I'm not familiar with UI5 and with the tutorial.

Cheers,

Carlos

Former Member
0 Kudos

Thanks for your help Carlos, I'll check it.

Regards,

Swetha