Inject interceptor into web service interface?

Aug 13, 2009 at 2:42 PM

Hi,

Is it possible to inject into a web service interface? For example I have the below service.
Can I somehow inject an interceptor that is invoked for the "HelloWorld" method?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace WebService3
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
    }
}
Thanks.
Aug 13, 2009 at 3:10 PM

You can modify the behavior of the WCF Service - perhaps the following Blog w/webcast might answer your question.

http://www.global-webnet.net/blogengine/post/2009/01/03/Integrating-IIS-WCF-and-Unity.aspx

 

 

Aug 14, 2009 at 7:34 AM

Thanks, that was what I wanted!