Deny HttpHandler WCF Request Processing

I have a website hosting the WCF and HttpHandler service. When I turn on aspNetCompatibilityEnabled, the HttpHandler starts collecting my WCF requests. I would not think that this could happen due to the .svc extension, and the handlers are not configured to handle .svc files. The handler is registered as follows:

<system.webServer> <handlers> <add name="TTPDeploy" path="*.deploy" verb="*" type="ServiceHost.DeploymentHandler" resourceType="Unspecified" preCondition="integratedMode" /> <add name="TTPManifest" path="*.manifest" verb="*" type="ServiceHost.DeploymentHandler" resourceType="Unspecified" preCondition="integratedMode" /> <add name="TTPApplication" path="*.application" verb="*" type="ServiceHost.DeploymentHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" /> </handlers> </system.webServer> 

I am sure that this is simply because I do not understand anything about WCF and HttpHandlers. Thoughts?


Update

I decided to solve the problem differently. Since I could not get my WCF requests to work, and aspNetCompatibilityEnabled was true, I returned it back to false.

My main problem was that I needed to get the physical file path from my website using a WCF call. I found another message (which I cannot find now) that is indicated when using WCF to get the path to a physical application, you should use HostingEnvironment.ApplicationPhysicalPath . This is a much more direct approach to the problem, but still does not answer this question.

Why does my handler pick up my WCF requests when it is not registered in .svc files?

+4
source share
1 answer

IIS picks up the request due to some configuration, maybe in the machine.config file.

In order for the request to get into your handler, add the following to the web.config file:

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

Source: https://habr.com/ru/post/1337807/


All Articles