开发者

WCF REST Starter Kit has ugly URIs

开发者 https://www.devze.com 2022-12-12 03:25 出处:网络
This starter kit seems to use incredibly ugly URIs that include a \"Service.svc\" filename. Surely if you\'re going to h开发者_开发技巧ave a service called say \"Users.svc\" you\'d want the URI to lo

This starter kit seems to use incredibly ugly URIs that include a "Service.svc" filename.

Surely if you're going to h开发者_开发技巧ave a service called say "Users.svc" you'd want the URI to look like '/users/' rather than '/Users.svc/'?

Is there a way this can be fixed?


This is a limitation of hosting the WCF REST Service in IIS - for the time being, this requires a *.svc file and that file shows up in the URL.

You do not have this limitation:

  • if you self-host - create a NT Service or a console app and instiate and open a "WebServiceHost" inside it - you can pick your service URL at your liking
  • if you can wait 'til .NET 4 in March 2010 - it will have "file-less" activation in IIS (search for "File-less Activation (no .svc)" in the linked article), e.g. you can define *.svc-less services

Marc

0

精彩评论

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

关注公众号