Skip to Content
0

How to ONLY provide a CDS OData Service via Hana Express Web IDE & @OData.publish : true

May 22, 2017 at 02:55 PM

535

avatar image
Former Member

Hello,

We have gone through several tutorials on using OData services, but still find that documentation has some gaps.

The tutorials and documentation describe how to use the @OData.publish annotation and use the OData service from within a java application in the same package. We are trying to figure out how to ONLY deploy the published odata service as a stand-alone that could be consumed in a variety of places.

How do we do this?

The documentation for the @OData.publish : true feature, says that the service would be available at

http://[baseurl:port]/java/odata/v4/[namespace]._.[context]/$metadata

but where exactly is that?

How do i find the baseurl+port that my oData service is exposed on after the build?

Thanks,

Lindsay

10 |10000 characters needed characters left characters exceeded

Hi Everybody,

I have almost the same problem - how to simply expose a oData service based on a .hdbcds data source - without the need to import a lot of modules and customize .yaml files - when we just want to provide an oData file based on a hana CDS definition - without the want to use this then in the hxe environment - just as a service for another provider.
Is there a way to accomplish this ? I now get we need to use the java modules for the "@OData.publish : true" - but also the video is not up do date with the newest Web IDE on Hana anymore.

But also with the .xsodata file the process seems to be a lot more complicated than on the normal HANA version where we just need to create the .hdbdd file and the .xsodata file based on this and we are fine to go :) - but in the hxe it looks just to complicated to publish a simple odata service and when I find a tutorial I need to go back and also do 5 other tutorials and create so many artifacts ?

0

That is the current state of development process. You need to create an MTA application as base to expose an OData service in the XSA environment. Using the module assistants makes it already very easy.

The linked videos are based on HANA 2.0 SPS00, so they just the new features introduced with SPS01 are missing. But in general nothing has changed.

In general I would say, that it is not really complicated to expose an OData service. As with every "new" technology, a person has to sit down, understand it and then (in most cases) it can be applied.

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Florian Pfeffer
May 23, 2017 at 04:20 AM
1

Hello Lindsay,

from your question content it is not really clear, for what exactly you are looking for. But have you checked already the following two SAP HANA Academy videos which gives some more details on the usage of the @OData.publish annotation + Java module usage for the "generated" OData services?

Regards,
Florian

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks for these - they were helpful, though in the end it also required information from the following to make it usable in SP02 as actually using the Java service in an HTML app had the wrong `mta.yaml` reference.

Routing Issue: https://answers.sap.com/questions/96808/sap-hana-xs-advanced-20-failed-to-resolve-referenc.html

Hana 2.0 SP02 examples branch: https://github.com/SAP/com.sap.openSAP.hana5.example/tree/hana2_sps02

MTA.yaml of the same: https://github.com/SAP/com.sap.openSAP.hana5.example/blob/hana2_sps02/mta.yaml
this shows change from `~{service_url}` to `~{url}` in the definition of the java destination for the html5 app.

0
Frank Schuler
May 22, 2017 at 03:04 PM
-1

Hello Lindsay,

In this blog (on a different topic) I describe how to provide a simple OData service from a HANA system via the Web Based Development Workbench that is also available in the HANA, express edition.

Measure your Raspberry Pi sensor data on the go with the Smart Business Service

Best regards

Frank

Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Frank,

Thanks for responding - it's an interesting post - but unfortunately I think your link is somewhat unrelated. You blog shows how to create and use a manually defined xsodata service using the Hana Development Workbench.

In contrast, what I'm asking for is how to utilize the the `@OData.publish` annotation in the `.hdbcds` definitions, which according to the XS Advanced documentation is only available via the built-in Hana WebIDE and access this service endpoint.

Have I missed how your blog explains this?

0

Sorry Lindsay,

I misunderstood your question. You will find the URL of your service in transaction /IWFND/MAINT_SERVICE:

Expose CDS View as an OData Service

Best regards

Frank

0
Former Member

ah thanks...how can i access this /IWFND/MAINT_SERVICE transaction in Hana Express? Do I need to use eclipse, cli, or is there a browser-accessible link to it?

0

Sorry, Lindsay.

Could you please explain your exact scenario again. Are you running a SAP Web Application Server ABAP with HANA as its database or just the native HANA, express edition? I am asking, because Core Data Services (CDS) are an ABAP on HANA concept.

Best regards

Frank

0
Former Member
Frank Schuler

Hi Frank,

Actually there are two flavors of CDS: Hana CDS and ABAP CDS (https://blogs.sap.com/2015/07/20/cds-one-model-two-flavors/); however afaik ABAP CDS is not available on Hana Express because it has no ABAP stack....

Best,

Lindsay

0