views:

980

answers:

3

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>
A: 

Did you check IIS settings and add .svc file extension to be handled by the same handler as other .net files? Follow this link to configure IIS (various versions) for custom file extensions.

http://msdn.microsoft.com/en-us/library/bb515343.aspx

Robert Koritnik
A: 

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
+5  A: 

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.

spoon16