C# 带有spring的URL WCF RestFul.net

C# 带有spring的URL WCF RestFul.net,c#,wcf,rest,spring.net,wcf-rest,C#,Wcf,Rest,Spring.net,Wcf Rest,我需要使用标准url restful调用我的服务: http://localhost/users : getall user http://localhost/user/1 : get user with id 1 但WCF中的标准URL如下所示: http://localhost/Userservice.svc/getallusers 我想对此进行更改,但由于我在服务WCF中使用了Spring.net框架,因此必须创建自定义ServiceHostFactory MyServiceHostF

我需要使用标准url restful调用我的服务:

http://localhost/users : getall user
http://localhost/user/1 : get user with id 1
但WCF中的标准URL如下所示:

http://localhost/Userservice.svc/getallusers
我想对此进行更改,但由于我在服务WCF中使用了Spring.net框架,因此必须创建自定义ServiceHostFactory MyServiceHostFactory

Spring在我的项目中用于执行注入依赖项,因此没有新对象

我尝试在global.asax中添加路由

RouteTable.Routes.Add(new ServiceRoute("Users", new MyServiceHostFactory(), typeof(UserService)));
但是当我呼叫我的服务 ,我收到错误:
ServiceHost仅支持类服务类型

我不理解这个问题,有可能解决这个问题吗


感谢您的帮助

这是您需要在服务器级别更改的设置。如果您是通过IIS本地主机为其提供服务,则需要更改本地IIS上的设置以允许无扩展URL。首先确保已应用此更新:此博文中包含其他说明:我在Windows 8中使用IIS 8.5,因此未找到此操作系统的qfe版本,并且在我的IIS中始终配置处理程序映射ExtensionlessUrlHandler-ISAPI-4.0\u 64位已启用。我需要做什么才能工作?你考虑过URL重写模块吗?在我知道你使用的是哪个版本的IIS之前,我不能推荐它。