简体   繁体   中英

Difference between ISAPI rule and Method UriTemplate

I'm trying to understand basic concepts of using .NET URL Rewrite.

I have a WCF REST Service which exposes several methods.

When invoking a method, I can define a URITemplate for it

Eg

[OperationContract, WebGet(UriTemplate = "/A/B?start={start}&finish={finish}&destinations={destinations}&resolution={resolution}")]

How is that different from defining ISAPI rule?

Answers would be appreciated.

So after getting no responses nor answers, I decided to post my own answer, which I think is good enough.

Both options allows rewriting the URL.

The ISAPI (.NET URL Rewrite) allows doing it in the IIS level , while the Method attribute is in the application level .

This means that:

  1. Changing the Rewrite rule for the method attribute will need to be followed by a compilation, as this is a code change, while changing the IIS rule will need to be followed by a recycle of the application pool.

  2. In addition, while in the IIS level, the rule can be defined for multiple applications, which cannot be done using the method attribute.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM