Service Route Issues

Topics: Web Api
Nov 5, 2010 at 2:57 AM

I have a very simple service route that I have defined like this:

RouteTable.Routes.AddServiceRoute<TodoResource>("todos"new TodoConfiguration());

And then I have a service method like this:

[WebGet(UriTemplate = "")]
public JsonValue Get()
return todos;

All of this works fine if I hit http://localhost/todos/ but if I hit http://localhost/todos without a trailing "/" I just get one of those generic service description pages which tells me that "Metadata publishing for this service is currently disabled." Is this just the way that the ServiceRoute class works? Or is it something I am missing? If this is the way that the ServiceRoute class works, then it really needs to be addressed.

Nov 5, 2010 at 8:24 AM

It's bug in the prototype bits. It will be fixed with our next drop. Can you deal with it for now?


Nov 5, 2010 at 11:05 AM

I'm trying to integrate it with Backbone.js and requiring a backslash will force me to modify their source. For now I can do that to get around it, but it is an ugly hack, and won't help others out so much.

Nov 5, 2010 at 2:58 PM

Hi Justin

I'll look into this and see if we can come up with a fix for the drop.


Nov 5, 2010 at 3:26 PM

Cool, thanks. I looked in the code and it seems that under the covers you guys are just using the ServiceRoute class, and without replacing that, I'm not sure what you could do to get around it.

Nov 5, 2010 at 6:02 PM
It's not necessarily anything to do with ServiceRoute. It has to do with our service host and base addresses. I will get you a better answer once I look a bit deeper.