Olingo odata 2 structure and flow of work - odata

Recently I joined new company. In that company they are using odata 2 for REST API's and JPA for ORM.
Can any one explains how exactly this odata 2 olingo frameworks works. I am familiar with MVC, Spring MVC, RestController.
But I am not able to get this olinog odata 2 flow, to create project from scratch.

I believe Spring MVC knowledge will not help you to understand Olingo framework.
A good start is reading OData basics if are not familiar with this protocol.
Then you can play with Olingo. They have a great sample project, just follow instructions from the documentation.
Investigating sample project + reading examples will help you to get familiar with Olingo quickly.

Related

How to Use Swagger with Ocelot in Asp.Net Core 2.1

I want to showcase all my endpoints of an API Gateway in Swagger. For gateway, I have used Ocelot with Asp.Net Core 2.1 but Ocelot's documentation says it does not support Swagger. Anyhow, if anyone can give suggestion on this?
I have already investigated the approaches to achieve this. For now if you are not going to re-invent the wheel with custom your own implementations, then the MMLib.SwaggerForOcelot package is the option to go with. Please follow readme file provided by link above. It covers all aspects of using that package.

Olingo - OData Help needed?

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

sample app to illustrate use of OData in NancyFx

I am developing a sample app to illustrate use of OData in my application(NancyFx based).
Can any one help in get started with this.
First, I'm not familiar with NanchFx. As far as I know, it is a different framework to build Web application than Web API.
Second, what do you mean a "sample app" ? Is that a app to build an OData service or to consume a OData service? If it's for server side, maybe you need to get started with ODataLib. If it's for consuming, then maybe a little bit more options like OData client for .NET, OData client code generator, and other JavaScript library supporting OData like JayData, Olingo ODataJS, Breeze, etc. HTH

How to implement OAuth2 in Jersey?

I developed a JAX-RS project. I used Jersey for it. I'm trying to figure out what's the best solution for authentication, since my API will be consumed through a web and a mobile application.
OAuth2 seams to be the best solution for the case.
Does anyone know a good and easy to follow example on the subject?
Please try srb4j, a simple RESTFul backend for Java, with out-of-box, oauth2-based authentication.
Its tech stack is: Jersey2 + Spring + MyBatis + MySQL. Since it's an open source project, you can replace MyBatis/MySQL with the persistence frameworks and DBs you like.
It's "easy" enough, since you can set up the project in a few minutes.

ASP.NET MVC API or WCF API

I'm developing an ASP.NET MVC 3 application. I need this application to make use of an API I also need to implement. The API should both be available from ASP.NET MVC controller actions and Ajax. Now it is quite easy to make an API using ASP.NET MVC, but is it possible to use this from other ASP.NET MVC website actions? I guess the WCF is quite easy to use as it is just a service reference.
Other users of the API could be Windows Phone and iPhone.
Update:
Many only sees the API as a place where you consume data, but what about the part where you want to execute commands or do stuff, like add customer or change foo?
You may want to check our new WCF web API that was announced at PDC. We recently released a big upgrade. WCF Web API is designed specifically for allowing you to expose APIs to a range of clients in a pure HTTP manner. It is lightweight, offers a nice configuration story (no configuration files) and also is much easier to test.
You can download the bits at wcf.codeplex.com. It includes various samples, and there is also a set of NuGet packs for getting you started. Search for webapi.all on NuGet.
The way I like to do this is with RESTful controller actions. You can return JSON and use your calls with JavaScript on your own site. Other websites would almost certainly understand JSON and so they'd be able to consume your API pretty easily. This is much easier to write and test than a heavy WCF layer.
Check out this question for some example REST frameworks for MVC:
ASP.NET MVC REST frameworks
One of the newer ways of accomplishing data feeds is using OData. Scott Hanselman has a great introduction to it in Creating an OData API for StackOverflow including XML and JSON in 30 minutes.
It allows you to even throw LINQ queries into your URLs to retrieve exactly the data you need.
Open Data Protocol (Official site)
Open Data Protocol (MSDN, Microsoft)
WCF JSON binding was really terrible last time I used it. WCF also comes with all sorts of crazy rules about streams and how you have to use [MessageBody] attributes for everything.
It was a real PITA to me.
I knew I've answered something like this before:
What is the best way to implement a RESTful architecture in .NET today?

Resources