I wrote a simple REST Collection WCF service with REST Start Kit Preview 2. The template project provides a Service class with a Dictionary collection instance as its internal collection items. Each item has a key and a value.
The problem is that if the key contains a '.' such as 'ProductA.Item1', then my query to a specific item will not work. The url GET request to this item is something like:
http://localhost:1247/Service.svc/ProductA.Item1
It looks like that IIS treats the URL as a resource instead of passing xxx.xxx as a parameter to my REST service's OnGetItem(string id) method. If I remove the part of '.Item1' (building the internal collection with none-dot-like keys such as 'ProductAItem1'), it works fine.
I even tried to change me WebGet attribute's UriTemplate to Products({id}), and then tried this customized URL:
http://localhost:1247/Service.svc/Products(ProductA.Item1)
http://localhost:1247/Service.svc/Products('ProductA.Item1')
Still I cannot reach to my code OnGetItem(string id) method. Without dot-like keys, the customized URL works fine as well.
I am not sure that dot or '.' in URL is a special character by IIS server or not. How can I escape it or make it like string parameter with dot inside if it is special char? Or I just cannot use the dot in my URL at all?