I dealt with a similar issue by setting the split for the path to be 1.  It 
defaults to 0.

For example, I had code like the following when setting up the ODataHttpHandler:

ODataHttpHandler handler = odata.createHandler(edm);
handler.setSplit(1);

-----Original Message-----
From: Vinayak Joshi [mailto:[email protected]] 
Sent: Thursday, January 14, 2016 4:10 AM
To: [email protected]; [email protected]
Subject: Olingo V4 - customizing the service root uri

Hi,

I am trying to build a dynamic OData solution where a user can build multiple 
OData services e.g. to different data sources.

My current attempt at doing this is by creating a single entry servlet.

When a user configures an OData service, I assign a unique "service-id" for the 
generated service and inform the user that his service is generated at say :

http://example.com/odata/service-id/

My entry servlet is configured to receive calls at  /odata/*

The entry servlet reads the service-id from the pathInfo () and routes the 
request to the appropriate ODataHTTPHandler -> handler.process (req, resp);

My problem currently is that doing this makes OData respond with this error:

"Cannot find EntitySet, Singleton, ActionImport or FunctionImport with name 
'service-id'"

It appears OData is inspecting the servlet path on the incoming request to 
determine what needs to be done and takes 'service-id' in the path to be an 
entity etc.

Looks like if I can inform OData in some way to consider 
http://example.com/odata/service-id/ as the service root uri instead of 
http://example.com/odata/ , then my problem would be solved. Is there a way to 
do this with Olingo V4 ?


P.S:
This is a first so please excuse me for sending this mail off to both user and 
dev mailing lists. Was not quite sure which of the two was the right mailing 
list for this query. If someone points out - I can take care going forward :)

- Vin

Reply via email to