0

I am trying to read the metadata from an OData Endpoint using Apache Olingo library. I want to get the list of Schemas that are there in the service.

Sample code goes like this-

 DataServices services; //TODO:
 for (Schema schema : services.getSchemas()){}

How do I intialize this 'services' variable?

Simon Opelt
  • 6,136
  • 2
  • 35
  • 66
prerna30
  • 131
  • 1
  • 2
  • 15

1 Answers1

0
  1. Fire an HTTP request to the OData endpoint and get the response as an Input Stream.
  2. call the Olingo API - EntityProvider.readMetadata(content, false); where content - InputStream and second param tell whether the lib should validate the metadata.
  3. The Olingo API in step 2 returns an Edm object that can be used to get the elements of Edm.

However I dont see a method in Edm that can give schema information. You could always raise a ticket at https://issues.apache.org/jira/browse/OLINGO for missing features or bugs.

Refer - http://olingo.apache.org/doc/tutorials/OlingoV2BasicClientSample.html for some more details.

Regards Chandan

Chandan VA
  • 36
  • 2