tuomur / python-odata

A simple library for read/write access to OData services
MIT License
79 stars 59 forks source link

No entities returned on calling ODataService. #20

Closed ankitjha97 closed 6 years ago

ankitjha97 commented 6 years ago

I am getting a dictionary with no entities on executing Service = ODataService(URL, auth=my_auth, reflect_entities = True) Service.entities

What could be the possible reasons for this?

tuomur commented 6 years ago

Metadata probably contains something python-odata doesn't understand. Can you link/attach the metadata xml here?

ankitjha97 commented 6 years ago

@tuomur , here is the JSON data. It's not the metadata though.

{ "d": { "results": [ { "__metadata": { "type": "MLW_RESOURCES.CONTENTType", "uri":"http://mlbooks:8001/MLW/resources/JOINED..xsodata/CONTENT(BOOKS='1',NAME='LINEAR ALGEBRA')" }, "BOOKS": "1", "NAME": "LINEAR ALGEBRA" } ] } }

Please ignore the indentation. P.S : You can use the some JSON beautifier for it. The link is: https://codebeautify.org/jsonviewer

tuomur commented 6 years ago

That looks like OData 2.0 structure. python-odata supports only 4.0.

ankitjha97 commented 6 years ago

Thanks. I am closing the issue with one question: @tuomur , is there any package which I can use to access the data using OData services?

tuomur commented 6 years ago

No idea. I'd just use plain old Requests to get/post json.