What MS technology to use for HTTP service returning XML?

Posted by Borek on Stack Overflow See other posts from Stack Overflow or by Borek
Published on 2010-05-10T20:10:04Z Indexed on 2010/05/10 20:14 UTC
Read the original article Hit count: 293

I need to create a service that:

  1. accepts HTTP requests (with query string or HTTP POST parameters)
  2. does some processing on the requests (checking if the request is valid, authentication etc.)
  3. reads data from a custom store (another HTTP call in our case)
  4. returns the result as custom XML (defined with XSD)

I'm trying to think of various MS technologies that could help me and how good they would be for this scenario (pretty standard one I guess).

The tasks above are relatively separate, this is what comes to mind:

HTTP front-end:

  • ASP.NET Web Forms
  • ASP.NET MVC (seems more appropriate here as I won't need server controls, view state etc.)
  • WCF? Don't know much about it or how well it would suit my task.

Custom logic on the server:

  • this will probably be a generic C# code in all cases (sometimes "plugged into" or called from MVC controllers or some equivalent place in other technologies)

Reading data from internal data stores:

As said, this is another HTTP server in our case. Options that come to mind:

  • Just read the data using something like WebClient
  • (Just theoretically) implement a LINQ provider
  • (Just even more theoretically) implement an EF provider

Output the data as custom XML:

  • Linq2XML
  • Serialization? Is it flexible enough?
  • Does WCF provide some tools for this?
  • Some "OXM" - Object/XML mapper if there is something like that for .NET

I may be wrong in many of my assumptions, this is just a quick list that comes to mind after a quick research.

Some general notes / questions:

  • Testing is important
  • Solution with a clear domain model would be much preferred over the one without
  • Can Entity Framework actually help somewhere in my scenario? If so, where and how?
  • Would WCF be an appropriate technology for this? I don't know much about it.

© Stack Overflow or respective owner

Related posts about technology-choice

Related posts about http-service