cancel
Showing results for 
Search instead for 
Did you mean: 

Odata java client for SAP Commerce Cloud?

abderzakeboufeta
Explorer

Hi all,

I'd like to use the oData services of a on-premise SAP Commerce Cloud instance from a java client.

The current documentation of the OData services on Commerce Cloud only references bare" http requests(GET, POST, DELETE). I think that means that Commerce Cloud has yet to provide some better integration: indeed, I've been unable to find any java client available to address "on-premises" OData services: I did find plenty of documentation on how to do address services hosted on Cloud Foundry ou Neo by leveraging the very nice SAP Cloud SDK though.

On the other hand of the spectrum, there are a couple of projects allowing to generate the model representation of oData entities, leveraging the Apache Olingo project but which don't provide all the abstraction layer (over the http client plumbing, for instance) we would expect.

I'm assuming that Commerce Cloud will eventually provide this java client interface...

Any advice from you on what is the recommended solution to use in the meantime will be greatly appreciated.

Many thanks,

Cheers

gregorw
Active Contributor
0 Kudos

I would think the SAP Cloud SDK is the way to go. But perhaps henning.heitkoetter can comment here for more insight.

abderzakeboufeta
Explorer
0 Kudos

Hi gregorw ,

Thanks for the tip, I'll try to have henning.heitkoetter's feedback and will update the content afterwards.

Accepted Solutions (0)

Answers (3)

Answers (3)

HenningH
Advisor
Advisor
0 Kudos

Hello Abderzake,

the SAP Cloud SDK indeed provides an OData client and a generator that you can use to get an easy-to-use Java client for an OData v2 API. The SDK is meant for building applications that run on SAP Cloud Platform, which is the reason why you see some of the issues that you mention in your post. Still, looking forward it would be interesting to us to get more details on the issues you mentioned, particularly the one about binary compatibility issues (the first one may be solved by moving to version 3 of the SDK).

Please note that you would also be able to host an app on SAP Cloud Platform that accesses an on-premise instance via the SAP Cloud Connector (see this deep dive for an example of accessing SAP S/4HANA on-premise).

Best regards,

Henning

abderzakeboufeta
Explorer
0 Kudos

Hi @ivan.mirisola,

Thanks for your input.

I indeed went down the Cloud SDK way, and.... I'm hoping for the best....

I've generated the java model sources from the edmx model view available from the Commerce Cloud instance, that I have included in my integration project sources. From there, it's indeed really nice and easy to use the fluent API of the ODataQueryBuilder to implement service requests.

Yet, I'm still not sure it the good solution 😄 :

  • I've already had to "hack" dependencies (web filters) that are targeted at "cloud" applications(cloud foundry or neo).
  • I'm facing binary compatibility issues between my client project and the sdk dependencies, seemingly coming from the fact that my client project runs on jdk11(required by version 1905 of Commerce Cloud) versus the required 1.8 version of java enforced on the cloud sdk libraries.

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ,

My understanding is that gregorw is correct that Cloud SDK is the way to go. However, AFAIK the Cloud SDK currently doesn't have the VDM for objects in SAP Commerce Cloud. Thus, you probably want to use the ODataQueryBuilder to reach out to your backend system. A simple way to understand this is by looking at step2 of the following tutorial:

https://developers.sap.com/tutorials/s4sdk-odata-service-cloud-foundry.html#6e69a4d2-fa31-47e3-9b69-...

It uses the Cloud SDK for service development so you can create OData queries to your backend system without all the hassle of a full-blown Olingo development.

Hope this helps.

Best regards,
Ivan