Note that there are some explanatory texts on larger screens.

plurals
  1. POSpecial character in WCF url $ no longer on WIndows 2012 with .NET 4.5
    primarykey
    data
    text
    <p>I have a WCF REST API which uses uri templates. One of these Uri templates looks like this: [WebGet(UriTemplate="List/Data.svc/$count")]. </p> <p>In windows 2008r2 this url works fine, but fails on some 2012 servers. When I look at the logs (logs I internally write, not the IIS logs), the 2008r2 request looks like this:</p> <pre><code>"http://myserver:40217/List/Data.svc/$count" </code></pre> <p>The 2012 server url looks like this:</p> <pre><code>"http://myserver:40217/List/Data.svc/%24count" </code></pre> <p>The exact same app on the same device is making both requests, so I am 99.999% sure this is not a difference in how the app is making the request. </p> <p>Does WCF do any url encoding for incoming requests?</p> <p>There are quite a few KB fixes related to .NET 4.5 on Windows Server 2012 for WCF, but I cannot find a comprehensive list, and I have not found one that seems to be related to this issue.</p> <p>On a Windows 2012 server, if you go to .../test.svc/$test it works and you will see "test succesful!". If you do the same on a Windows Server 2012 r2 server, you will get "Bad!! This is not the right route!"</p> <pre><code> [WebGet(UriTemplate = "$test")] public System.IO.Stream GetTest() { return new MemoryStream(System.Text.Encoding.UTF8.GetBytes("test succesful!")); } [WebGet(UriTemplate = "{id}")] public System.IO.Stream GetById(string id) { if (id == "$test") return new MemoryStream(System.Text.Encoding.UTF8.GetBytes( "Bad!! This is not the right route!")); else return new MemoryStream(System.Text.Encoding.UTF8.GetBytes("You did a get by Id on " + id)); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload