3

I have to make a rather complex system for my diploma work. Logically it will consist of the following components:

  1. Database
  2. Web-service
  3. Management with web interface
  4. Client iOS application that will consume web-service

I decided to implement all the first three components under .NET. Firstly I will create a database depending on the information load - this is clear. But then I need a web-service that will return data in JSON format for iOS clients to consume - that's obvious and not that hard to implement. For this I will use WCF technology.

Now I have a question, if I implement the web-service, how will I be able to respond to POST requests with JSON? It probably involves WCF JSON or something related? But I also need some web pages as admin part, so will this web-application be able to consume my centralized web-services as well or I should develop it separately? I just want my web service to act like a set of controllers.

There is a related question here but this doesn't quite reflect my question.

2 Answers 2

1

You can use ASP.NET MVC with an Json serializer library such as JSON.NET.

However, I would recommend to use ASP.NET Web API as it is specialized for these kinds of operations. ASP.NET Web API is a very simply and easy to use and learn framework for such purposes.

Of course, WCF is also an option though it is more complex and the learning curve is a bit higher.

5
  • If I decide to go with WCF for learning purposes, will this be a good decision? thanks Nov 21, 2012 at 22:59
  • 1
    Yes, though ASP.NET Web API is also worth learning. WCF is probably too large to learn entirely for just your use case.
    – Sebazzz
    Nov 22, 2012 at 19:22
  • Thanks, I decided to go with ASP.NET MVC 4 Web API for my purposes! it's perfect for my case Nov 25, 2012 at 16:54
  • 1
    Confusing :) ASP.NET Web API and ASP.NET MVC are clearly two seperate technologies. While you can build a web API with ASP.NET MVC, its like putting a nail in the wall with the wrong side of the hammer: It works, but ASP.NET Web API is specifically build for creating Web APIs.
    – Sebazzz
    Nov 25, 2012 at 19:52
  • Well, that's exactly what I needed, I chose ASP MVC project with Web API template so that I have ApiControllers along with simple controllers :) Nov 25, 2012 at 22:13
1

I think .NET MVC with some controller actions returning JSON might be your best bet, as could deliver web app and the web service component with some nice RESTfull urls

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.