I am trying to create a custom OData v2 service in java with an S/4HANA Cloud data source using S/4HANA Cloud SDK. I tried to follow section 8.3 of the SAP Press book \"Extendi
The setup for OData V2 provisioning looks a bit different. So remove all modifications you did to use OData V4 provisioning. Then add the following:
Add the following dependencies (instead of the odata-v4 one) to your application/pom.xml
file:
com.sap.cloud.servicesdk.prov
odata2.web
javax.servlet
servlet-api
com.sap.cloud.servicesdk.prov
odata2.xsa
com.sap.cloud.servicesdk.prov
odatav2-hybrid
javax.servlet
servlet-api
com.sap.cloud.servicesdk.prov
odatav2-prov
Add the following entries to your application/src/main/webapp/WEB-INF/web.xml
file, replacing YOUR.PACKAGE
with a package to search for your OData endpoints:
ODataServlet
org.apache.olingo.odata2.core.servlet.ODataServlet
1
org.apache.olingo.odata2.service.factory
com.sap.cloud.sdk.service.prov.v2.rt.core.CloudSDKODataServiceFactory
org.apache.olingo.odata2.path.split
1
ODataServlet
/odata/v2/*
package
YOUR.PACKAGE
com.sap.cloud.sdk.service.prov.v2.rt.core.web.ServletListener
application/src/main/resources/edmx
directory.These steps should get your OData V2 Provisioning service up and running.