I'm new to the OData protocol.
I saw that it seems like there are 2 types of well-defined resources that describe the OData Service Data Model, which are Service Document and Metadata Document.
But I want to know that if both of these two resources can be found at the OData Service definitely / for sure?
Since I did not see any restriction from the OData specifications that OData Service must fulfil these 2 resources together during implementation, I guess that there is only one type of Service Data Model that can be found from service.
I really appreciate if any one can help to clarify it.
Thanks!
It depends on which libraries is used to implement the OData service. For example, if the service is implemented using ASP.NET Web API for OData or RESTier, the two documents will both exist for sure.
Related
Am pretty new to OData.
Per my internet reading what I've gathered is Apache Olingo is better (vs OData4j) for Java implementation of OData service and OData consumer.
Can you please help me with sample code of Olingo service and Olingo consumer?
Any help in this regard is much appreciated.
Have a good one.
Thanks.
First you'll want to consult Olingo's documentation here. Their documentation is alright for basics but once you start extending it there's not much out there. As you can tell from no one answering this for 18 hours OData doesn't seem to be a hot topic right now.
If you want to create a basic service without JPA this is a good resource: OData Service with Olingo
If you want to create an OData service that uses JPA this is a good resource: OData JPA Web App. Also this one is helpful Olingo OData with MySQL.
Here's a document on how to create a client: Olingo Client We actually use Excel as a client which is quite nice for Excel users. However, there are times when Excel has compatibility issues with certain features (EDM Complex Types). Here's some good documentation on how to use Excel and OData
I have a Web API using OData that I need to query. The client application is a SPA built with React/Redux, but it looks as if most data service libraries such as isomorphic-fetch do not support OData. Can BreezeJS be useful for me in this situation? Or OLingo's ODataJs? Any examples, tutorials, resources on using these or any other OData clients with Redux? AFAIK, I just need a the client library to query an OData source and support promises. And as far as the data I get back from the server, I just need simple json objects; no need for models that support binding.
I've seen discussions of Breeze + Angular/Backbone, but can it support Redux/React?
I doubt that either Breeze or ODataJS supports ES6, so if i had to wrap them in a ES6 module, would they still function properly?
Maybe it helps if you consider that OData isn't that far off from REST. If it's just about pulling the data from a OData service, you won't need much more than jQuery.getJSON and Breeze will work too. However, if you want to do it the fancy way, and want you app to introspect the meta-model and such, you should have a look at datajs or olingo.
Are both of Metadata Document and Service Document mandatory in OData V3?
According V3 core Protocal specification in Chapter 10.1.2, it said that OData services MUST expose a Metadata Document which defines all data exposed by the service.
So I believe Metadata Document is mandatory in OData V3, right?
But what about Service Document in V3?
Thanks for anyone's help,
According to the v3 spec:
2.2.3.7.1 Service Document
For a client to interact with a data service, it needs to discover the locations of the available collections of resources. AtomPub [RFC5023] defines Service Documents to support this discovery process.
The ServiceRoot of a data service MUST identify the Service Document for the data service.
More importantly, the general concept of a service document is a really important and fundamental REST API concept. REST says that there should be a single entry point that allows a generic hypermedia client to traverse the service. This would be a great time to paraphrase George Orwell: all REST principles are important but some are more important than others. Having a service document will be one of the "more important" principles if you care about generic OData clients like Excel.
I'm a little bit confused that metadata doucment in OData Service.
As odata-v4.0-part1-protocol doc mentioned, there are two well-defined resources that describe its data model, a service document and a metadata document.
I want to know if that means both of these two resources must be implemented during development of OData Services, or developers just only need to implement one of them by their own choices?
I do appreciate anyone's help.
Thanks
Not necessarily. According to the "13.1 OData Service Conformance Levels" of OData V4 spec:
for minimal conformance level "MAY publish metadata at $metadata according to [OData-CSDL] "
for intermediate conformance level " SHOULD publish metadata at $metadata according to [OData-CSDL]"
for advanced conformance level "MUST publish metadata at $metadata according to [OData-CSDL]".
In other word, this means metadata is NOT a must for OData V4 service but service document is a MUST. If you have a deeper understand of OData, there are two kinds of OData libraries -- server and client, the metadata document of OData is for advanced client to know more about the service(models, types and so on). So having metdata document or not actually depends on whether you want your service to be talked to as much clients as possible.
I an new in iPhone.Currently i am working on OData based web service. But i am little confusing with how to call webservice and getting response with OData.I have below information with me.
The metadata of this service is located at :
http://enumbler.azurewebsites.net/odata/$metadata
and Base url is :: http://enumbler.azurewebsites.net/odata/User
Can anyone help me to solve this?
Thanks in advance.
I'm not familiar with IOS, but I may help with common way to consume OData services. Take one OData sample service TripPin, if you want to get all airlines, you can simple calling http://services.odata.org/V4/TripPinService/Airlines. The response is in JSON payload, you can consume this either directly dealing with JSON or use some OData client libraries for IOS. One difference your service and the sample service has may be that TripPin is OData V4 and your service is OData V3. Maybe your service doesn't support JSON but ATOM payload, but you can deal with either way I mentioned above. For more detailed information of OData, you can go directly to OData.org. Hope I helped you with part of your problem.