开发者

How to handle Error 500 coming back from asmx service

I have a standard asmx service on which GET is not allowed.

If I visit the asmx http://mysite/myservice.asmx/myoperation in the browser (GET) I get a stack trace flushed to the client and I can see from fiddler it's a 500 internal system error. None of my code is being hit.

I have a requirement not to show a stack trace if the url is visited from the browser, so I'd like to 开发者_高级运维redirect to a custom error page I have in place.

I have an Application_Error on the global.asax but its not kicking in in this particular instance.

Any help appreciated!


What happens if you disable GET requests via

<configuration>
   <system.web>
      <webServices>
         <protocols>
            <remove name="HttpPost"/>
            <remove name="HttpGet"/>
            <remove name="Documentation"/>
         </protocols>
      </webServices>
   </system.web>
</configuration>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜