Work With Odata in Web API: Understand Odata in Web API
Hi all, I hope everything is fine. Me too. I recently got 3 a day leave (weekend and one leave day) and thought we would learn something new that can expand us more in the world of web programming. I thought, what can I learn? What to learn? Then suddenly one word came to mind. The previous day as I was sitting at my next desk at the office and I heard someone talking regarding Odata. (Oh, it was in their project.) That got me thinking. Now understand that I really don't know much about Odata and in my free time I need to learn.
As a result of that I thought I would spend a few hours this weekend learning about Odata. I did and cannot resist the temptation to write a few lines about it.
What is Odata? What's wrong with SOA?
When I was reading a few posts and articles I was seeing, people asked such questions as, what is the difference between Odata and the Web API, what is the difference between SOAP and Odata and many more. Hm, those technical jargons are not so transparent to people.
That often happens when one suddenly arrives at an ocean of technology for the first time. So, let's start our discussion. What's wrong with SOA. We know SOA is Service Oriented Architecture; we expose data in the form of a service. We write functions to get that data.
Let's think that we have written one function to return the employee name when someone will supplies the employee code. Working cool, but in the next data some other guy is asking to get an employee's address and he wants to supply the employee's name.
That is a new requirement. Hmm, I need to write another function. History repeats itself, in another fine morning another guy demands that he wants to get an employee phone number only when he supplies the employee code. Oh, again add another function to the existing service. Now, we know people are greedy and demanding, the new requirements will never stop. Then what is the solution? Shall we add a new function each time a new requirement arrives?
Don't worry, Odata is the solution. Let's understand what Odata is theoretically .
The Open Data (OData) Protocol is a data access protocol for the web. OData provides a uniform way to structure data, query the data, and manipulate the data using CRUD operations (Create, Read, Update and Delete). OData supports both AtomPub (XML) and JSON formats. OData also defines a way to expose metadata about the data. Clients can use the metadata to discover the type information and relationships for the data set.
The Odata protocol was initially defined by Microsoft and released under the Microsoft Open Specification Promise. Version 4.0 is being standardized at OASIS and released March, 2014.
So, as per our discussion, we know that SOA is Service Oriented Architecture that exposes a few functions to outsource data from the endpoint, this technique is pretty cool when the requirement is fridge or when we know the exact query pattern.

Manoj KallaPosted Sep 22, 2018, 3:00 AM
Sourav tu si great ho
Harmesh KaushikPosted Nov 6, 2017, 11:43 PM
Nice article.... Thanks
Carmel RajPosted May 18, 2017, 11:53 AM
Simple to understand..... Thank you.
Sandeep SharmaPosted Apr 11, 2014, 12:40 PM
thanku :)
Sunny SharmaPosted Apr 9, 2014, 2:01 AM
Good one!
Lakshmanan Sethu SankaranarayanPosted Apr 6, 2014, 2:01 AM
Good Intro!!