Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
190 views
Welcome To Ask or Share your Answers For Others

1 Answer

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...