Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpHandler to hook the *.svc requests

I'm trying to create a custom ASP.NET HttpHandler to work with any requests to a WCF web services (*.svc) to return a simple predefined SOAP message.

However, after added the HttpHandler to the web.config as shown below. It seems that IIS doesn't pick up the handler to execute. But, the same handler seems to be working fine with *.aspx

<remove verb="*" path="*.svc"/>
<add verb="*" path="*.svc" type="… " />

Does anyone know how to make the HttpHandler to work with the svc extension? or

Are there any other techniques to achieve the same goal?


Thank you everyone for your responses. I got my custom HttpHandler working now after adding the following config into the web.config file.

<compilation> 
    <buildProviders> 
        <remove extension=".svc" /> 
    </buildProviders> 
</compilation>
like image 555
SJ. Avatar asked Feb 04 '23 11:02

SJ.


1 Answers

In your web.config you need to add the following so that IIS will forward the response through to your handler:

<compilation>
    <buildProviders>
        <remove extension=".svc" />
    </buildProviders>
</compilation>

More information on MSDN.

Adding this as a proper answer.

like image 123
Eric Schoonover Avatar answered Feb 12 '23 09:02

Eric Schoonover