开发者

How to build URL of WCF REST web services

开发者 https://www.devze.com 2023-01-22 13:46 出处:网络
I am using the new .NET 4 WCF REST web services. In order to link resources, I\'d like to put links in my responses. In ASP.NET I can generate URLs from my routing configuration (e.g. UrlHelper.Action

I am using the new .NET 4 WCF REST web services. In order to link resources, I'd like to put links in my responses. In ASP.NET I can generate URLs from my routing configuration (e.g. UrlHelper.Action(...))

With WCF REST web services I have an ASP.NET routing configuration plus Uri templates:

[WebGet(UriTemplate = "{id}")]
MyResult Index(string id) {...}

I want to store related URIs in my result objects. How can I construct URLs from my routing configuration + UriTemplates without hardcoding base URLs or oth开发者_StackOverflow社区er information? Are there similar helper classes available?

Regards Hartmut

0

精彩评论

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