Click here to Skip to main content
15,881,687 members
Articles / Web Development / ASP.NET

Assembly-based webservice and Javascript proxy using reflection

Rate me:
Please Sign up or sign in to vote.
4.88/5 (17 votes)
30 May 2007CPOL6 min read 67.8K   326   33  
ASP.NET and Ajax Webservices, not from a .asmx file, but from a compiled assembly with a little bit of reflection
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.Services;
using System.Web.Script.Services;

namespace Devusion.CustomControls
{
    [ScriptService]
    [WebService(Namespace = "http://www.devusion.nl/xmlns/customcontrols")]
    public class Service : WebService
    {
        [WebMethod]
        [ScriptMethod(UseHttpGet = true)]
        public string HelloWorldYou(string name)
        {
            return DateTime.Now.ToLongTimeString() + ": Hello " + name;
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder Devusion
Netherlands Netherlands
Robertjan is an independent Developing and usability Consultant.

He has been a speaker at CodeCamp, TechDays and other venues. And blogs regularly on http://www.robertjantuit.nl

His specialaties are User Interfaces, Silverlight, WPF, Custom Controls and Software Architecture, Design and Agile development.

Comments and Discussions