You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Pablo Leira <pl...@denodo.com> on 2016/04/20 14:24:06 UTC

EdmEntityContainer in client olingo reading Odata V2

Hi,
I am using the odata client 4.2.0  to develop a client to access to the
different versions of OData. I can list the EDMEntitySets when access to a
server odata V4, but when I try to access a server Odata V2 the
EntityContainer and the EntitySets are empty, I only can read the
EDMEntityTypes.
The code that I am using is:

  EdmMetadataRequest request =
client.getRetrieveRequestFactory().getMetadataRequest(_serviceRoot);
        ODataRetrieveResponse<Edm> response = request.execute();
        Edm edm = response.getBody();

         for (final EdmEntitySet entitySet :
edm.getEntityContainer().getEntitySets()) {

                    entitySets.put(entitySet.getName(), entitySet);

        }

It is possible to read the EDMEntitySets from a server Odata V2?

Thanks
Regards
Pablo Leira

Re: EdmEntityContainer in client olingo reading Odata V2

Posted by Ramesh Reddy <ra...@redhat.com>.
Olingo 4.2.0 *only* supports OData v4, it does not support OData V2. For V2 there is another set of library in Olingo, look at 2.x versions. 

----- Original Message -----

> Hi,
> I am using the odata client 4.2.0 to develop a client to access to the
> different versions of OData. I can list the EDMEntitySets when access to a
> server odata V4, but when I try to access a server Odata V2 the
> EntityContainer and the EntitySets are empty, I only can read the
> EDMEntityTypes.
> The code that I am using is:

> EdmMetadataRequest request =
> client.getRetrieveRequestFactory().getMetadataRequest(_serviceRoot);
> ODataRetrieveResponse<Edm> response = request.execute();
> Edm edm = response.getBody();
> for (final EdmEntitySet entitySet : edm.getEntityContainer().getEntitySets())
> {
> entitySets.put(entitySet.getName(), entitySet);
> }

> It is possible to read the EDMEntitySets from a server Odata V2?

> Thanks
> Regards
> Pablo Leira