0 people following this project (follow)

Project Description
No WCF, no Webservices, no extensions on paths - just a Controller and voila!

This is only concept and not finished, yet.

Service (Controller) side

Service definition:
    public interface IAddService
    {
        int Add(AddParams p);
    }


Data transfer object (DataContract):
    [Serializable]
    public class AddParams
    {
        public int X { get; set; }
        public int Y { get; set; }
    }


Service implementation:
    public class AddServiceController : Controller, IAddService
    {
        public int Add(AddParams p)
        {
            return p.X + p.Y;
        }
    }


Client side

    var service = ServiceFactory.Create<IAddService>();
    var p = new AddParams() { X = 1, Y = 3 };
    int result = service.Add(p); // here is magic ;)
    // ... service.Add(1, 3); multiple input parameters are not supported, yet
    Assert.IsEqual(4, result);



Full description? Almost there...
Please, be patient... :)


Server part resources:
http://omaralzabir.com/create_rest_api_using_asp_net_mvc_that_speaks_both_json_and_plain_xml/
http://aleembawany.com/2009/03/27/aspnet-mvc-create-easy-rest-api-with-json-and-xml/

Client part resources:
http://www.castleproject.org/dynamicproxy/index.html
http://kozmic.pl/articles/castle-dynamic-proxy-tutorial.aspx

Last edited Oct 4 2010 at 2:22 PM by dariog, version 9