HttpHandler的勾* .SVC请求 [英] HttpHandler to hook the *.svc requests

查看:237
本文介绍了HttpHandler的勾* .SVC请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个自定义ASP.NET的HttpHandler的任何请求到一个WCF Web服务(* .SVC)返回一个简单的predefined SOAP消息。

工作

然而,后添加的HttpHandler到web.config如下所示。看来,IIS不拿起处理程序来执行。但是,相同的处理似乎是工作的罚款与*的.aspx

 <* SVC去掉动词=*路径= />
<添加动词=*路径=* SVC。TYPE =.../>

有谁知道如何做的HttpHandler与SVC扩展工作?或

是否有任何其他技术来达到同样的目标?


谢谢大家您的答复。我得到了我的自定义的HttpHandler现在加入下面的配置到web.config文件后工作。

 <编译>
    < buildProviders>
        <删除扩展= /&GTSVC。
    < / buildProviders>
< /编译>


解决方案

在你的web.config你需要添加下面让IIS将通过你的处理转发回应:

 <编译>
    < buildProviders>
        <删除扩展= /&GTSVC。
    < / buildProviders>
< /编译>

在MSDN

更多信息。

添加这是一个正确的答案。

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>

解决方案

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.

这篇关于HttpHandler的勾* .SVC请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆