views:

46

answers:

1

Hi, 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 other information? Are there similar helper classes available?

Regards Hartmut

A: 

check the following answer it might help,

http://stackoverflow.com/questions/444010/what-is-the-wcf-equivalent-of-httpcontext-current-request-rawurl

A_Nablsi
Thanks, at least that would help getting the original URL. However, I want to construct URL to other resources of my service using the ASP.NET routing information plus the Uri-templates of the service operations.
Hartmut Kocher