WCF REST Does Not Contain All of the Relative File Path
Posted
by Brandon
on Stack Overflow
See other posts from Stack Overflow
or by Brandon
Published on 2010-05-03T19:21:22Z
Indexed on
2010/05/03
19:28 UTC
Read the original article
Hit count: 251
I have a RESTful WCF 3.5 endpoint as such:
System.Security.User.svc
This is supposed to represent the namespace of the User class and is desired behavior by our client.
I have another endpoint I created for testing called:
Echo.svc
I am writing an overridden IHttpModule and in my module, I follow what almost everyone does by doing:
string path = HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath;
If I make a call to:
http://localhost/services/Echo/test
My path variable has a value of '~/echo/test'
However, when I make a call to:
http://localhost/services/System.Security.User/test
My path variable has a value of '~/system.security.user'
In my 2nd situation, it is stripping off the '/test' on the end of any endpoint that contains multiple periods. This is undesired behavior and the only solution I have found to fixing this is some ugly string manipulation using the property which does contain the complete URL path:
string rawPath = HttpContext.Current.Request.RawUrl;
This returns '/services/system.security.user/test'.
Does anyone know why my first situation does not return the rest of the URL path for endpoints that contain multiple periods in the name?
© Stack Overflow or respective owner