9

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>
John Saunders
  • 160,644
  • 26
  • 247
  • 397
SJ.
  • 113
  • 2
  • 7
  • 1
    thank you everyone for your responses. I got my custom HttpHandler working now after adding the following config into the web.config file. – SJ. Jun 06 '09 at 05:37

2 Answers2

12

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.

Eric Schoonover
  • 47,184
  • 49
  • 157
  • 202
0

You could simply not use the .svc extension... just use anything else that works, and tell the client the address. There may be additional goo associated with that particular exntension (dynamic compilation, etc).

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900