Recommendations for .NET Web Service Format/Protocol for Android, iPhone, etc. integration

后端 未结 4 1729
夕颜
夕颜 2021-02-15 16:22

I am building a web service for my ASP.NET MVC 3 website. Ideally I would like all clients (my web pages, iphone application, android application, windows phone 7 application, e

4条回答
  •  庸人自扰
    2021-02-15 17:22

    This would be a great opportunity for you to try out WCF Data services, together with Entity Framework. You can build it very fast, and it exposes your information model using the OData international standard in both XML and JSON flavor. The interface is accessible throught REST. No problems interacting with any front-end technology, fat, web or mobile clients.

    AND, you have all the benefits of re-using your C# .NET knowledge, visual studio and created assemblies to also make more tighter integration with Windows applications if you need to. It certainly did the trick for me!

    So:

    1. Create your application model using Entity Framework. Either database first if you already have a physical datamodel, or model first is you are starting from scratch.
    2. Expose the created information model using WCF dataservices (5 lines of code)

    You can find a walkthrough at: http://msdn.microsoft.com/en-us/magazine/ee336128.aspx

    Happy coding!

提交回复
热议问题