I am asked to develop (from scratch) a REST web service in .NET that wrapps calls to various data sources:
Databases (SQL, DB2, Oracle, etc)
Other web services (SalesForce, Microsoft CRM, etc)
Flat files
etc
In the end, we would display this data in web UIs : grid, charts, etc. Other features include: caching, usage monitoring, user roles management. And the idea would be to query this web service with a syntax similar to Open Data.
The data sources configuration would be done in a database, or in a configuration file.
Ex: Data source "DS1" is of type "Database" to server "srv001" on database "db001" and gets data from stored procedure "sp001".
Before I start developing that from scratch, I first googled to see if an existing stardard component exists for that. But I couldn't find any.
=> Is there an existing tool on the market that does it out of the box (or close to out of the box) ?
Thank you
Alex
There are lots of ways to expose data through a restful interface using .NET
For exposing a data source as a service you should use OData.
For combining various sources, as you mentioned, as your own mashup service use Web API
If your service is only going to be used internally I would use WCF which will be the most performant and easy-to-work-with option.
Related
When creating a new service for my Windows Phone 8.1 database is also created for that service.
Instead of using service created database, can I use my own database which is located in webhost4life.com? Can I use this database, located on that server, for data adding.
By default, whenever you create a mobile service, you're required to specify a SQL database as well. You do not need to use this database. You can connect to any database you want to, from your mobile service backend code, and do whatever you want.
Just note that might need to create custom API calls, rather than the built-in CRUD operations, since the CRUD operations take advantage of a table class derivative that takes care of a lot of ORM-based things for you. If you plan on bypassing all of that, then the custom API route will let you do that.
Yes you absolutely can ! Check out this blog post on how to connect mobile services to a MongoDB backend. You just need to overwrite the backend scriptlets to handle the CRUD operations http://blogs.msdn.com/b/azuremobile/archive/2014/04/14/creating-mongodb-backed-tables-in-azure-mobile-services-with-net-backend.aspx
When you create a mobile service,a SQL database is required by default. But Microsoft Azure also provide options to make it easy to take advantage of existing assests in building a mobile service. Supported assets include any resource that runs on a static TCP port, including Microsoft SQL Server, MySQL, HTTP Web APIs, and most custom web services.
See details at https://azure.microsoft.com/zh-cn/documentation/articles/mobile-services-dotnet-backend-use-existing-sql-database/ and https://azure.microsoft.com/zh-cn/documentation/articles/mobile-services-dotnet-backend-hybrid-connections-get-started/
im trying to perform a simple database insert from a submission on a SilverLight Webpage. Normally i would either use ADO or LINQ to SQL to perform this. You can not do this within a SilverLight Project, nor can you reference a project that can (a non SilverLight project). What would be the best way of doing this?
Thanks.
For the most part, Silverlight apps are designed to talk to web-based data services or databases via RIA services.
There are a a few approaches to your problem:
Reference a web service, like an .asmx or any REST servie
Use WCF to communicate to the backend
Use Silverlight RIA Services to talk to the database (it was designed to solve your problem)
Your best bet is to use the .NET RIA Services which will allow you to define server-side domain classes and due to the RIA Services link, will generate client side code in your silverlight project.
Another alternative if you don't want to use web services, is to Xml Serialization and Isolated Storage to store the files. You'd simply load the database into memory on startup, and then persist to the file when the apps closes, or periodically.
I understand the term used all over social networking sites is "API",
I did some research on the web, and it seems to be a very big topic to cover.
As per my previous post, I have made a social networking site using asp.net 3.0 and C#. It's a small prototype.
A few tables such that the record of friends and their friends and their interest is kept. There are no privacy constraint at the moment
What I would like is to, "welcome developers please download the API for free and start making applications for the social network". Consider application extracts interests of the friends of a friends who is using the application.
From what I understand, an API is a space to host an application either provided by me or the developer.
APIs are an interface to (all or some of) the functionalities of your application. In your particular scenario you can expose Web-apis by allowing remote http calls (for example by using web services).
http://en.wikipedia.org/wiki/Application_programming_interface#Web_APIs
It's a bit more complicated than just "Right-click add API..." but you have a few options:
WCF, WCF rest, and Data Services / oData
If you're in a desparate hurry to get an API out the quickest way will be to use oData/Data Services, you basically make your database queryable via the web. (You can restrict Read/Write access.)
It's as simple as creating an Entity Framework model for your database, and exposing that as a WCF Data Service and you're done.
http://msdn.microsoft.com/en-us/data/bb931106.aspx
http://www.odata.org/developers/odata-sdk
Following the KISS principle, I suddenly realised the following:
In .NET, you can use the Entity Model Framework to wrap around a database.
This model can be exposed as a web service through WCF.
This web service would have a very standardized definition.
A client application could be created which could consume any such RESTful web service.
I don't want to re-invent the wheel and it wouldn't surprise me if someone has already done this, so my question is simple: Has anyone already created a simple (desktop, not web) client application that can consume a RESTful service that's based on the Entity Framework and which will allow the user to read and write data directly to this service?
Otherwise, I'll just have to "invent" this myself. :-)Problem is, the database layer and RESTful service is already finished. The RESTful service will only stay in the project during it's development phase, since we can use the database-layer assembly directly from the web applications that are build around it. When the web application is deployed, the RESTful services are just kept out of the deployment.
But the database has a lot of data to manage over nearly 50 tables. When developing against a local database, we can have straight access to the database so I wouldn't need this tool for this. When it's deployed, the web application would be the only way to access the data so I could not use this tool. But we're also having a test phase where the database is stored on another system outside the local domain and this database is not available for developers. Only administrators have direct access to this database, making tests a bit more complex.
However, through the RESTful service, I can still access the data directly. Thus, when some test goes wrong, I can repair the data through this connection or just create a copy of the data for tests on my local system. There's plenty of other functionality and it's even possible to just open the URL to a table service straight in Excel or XMLSpy to see the contents. But when I want to write something back, I have to write special code to do just that. A generic tool that would allow me to access the data and modify it would be easier. Since it's a generic setup around the ADO.NET Data services, this should be reasonable easy too.
Thus, I can do it but hoped someone else has already done something similar. But it appears that there's no such tool made yet...
You are referring to ADO.Net Data Services. It basically creates an Entity Database Model and adds a REST frontend to the service using ASMX. There is a How To article availble from MSDN here on consuming the service using .Net. I have also done the same thing using the normally WebClient class in .Net in the past.
You can also look at the WCF REST Starter Kit if you want to roll your own based on Entity Framework. The starter kit also contains a handy new WebClient class that can be used to communicate with REST services.
Clarification
There is no prebuilt application client that I am aware off which will talk to these service, since they are pretty much accessing the data using Web Services. There is the Microsoft Smart Client Factory which is most likely the closest thing I have worked with.
I mentioned the above 2 options since they already have libraries in .Net that work with them directly, either as a referenced Web Service, or for the more adventurious, myself included, using the WebClient library or alternatively the new HTTPClient library in the WCF REST Starter kit.
I have used both, in Windows, Web, Silverlight and WCF. The latter being the easiest since they are focussed at REST.
We are currently investigating Prism which strongly leans to using this method when using WCF for front-end development.
Assumption
With regards to this question, you are making a generic assumption that wrapping ADO Entity Framework with a WCF service it will be generic. ADO.Net Data Services is the closest you will get, however the structure of the database will fundamently change the way you interact with it. Going a level higher in a "generic" way would be dangerous, as these 2 technologies, individually or together, are already as generic as possible.
In addition to Data Services (+1), consider RIA Services. It's like a domain-specific version of data services for Silverlight or WPF clients. Less flexible, but easier, than Data Services.
I have an application that runs on a server and uses SQL server 2005. If I wanted to make this application integratable with other systems such as a CRM, what would be the best strategy? My idea was to create a public Web Service with authentication...does this sound like the right approach?
Any idea's would be appreciated.
Yes, Ideally all integration is done using industry standard communication protocols, requiring some middleware that links these standards. Ideally these protocols would be something like a webservice as you say where the API ensures validation all data imported into your system.
Most basic integration between systems means Transfer of Data between systems. You can either choose to build an API to which you or others provide the middleware to connect. Or depending on the nature of the applications, you your case CRM, it may be worth ising this same API to build an Import/Export mechanism where users can just just Export their data into xml, CSV and also import their data, building a nice interace to map any CSV format to your own fields is a nice touch and means less technical users can perform non-automated tasks.