I have an old WCF 3.5 RESTful service that was at:
http://www.mydomain.com/rest/Service.svc
I have migrated my service over to a WCF 4.0 RESTful service that now resides at:
http://www.mydomain.com/rest/Service
Due to the new WCF 4.0 routing in the Global.asax, it automatically removes the .s开发者_Python百科vc extension for me. I was looking for a way to route the old base URL to the new base URL. I need to take into account that there will obviously be more after the Service name such as
Service.svc/MyEndpoint?param1=param1Val
Is this possible and if so, what is the best/most performant way to accomplish this task?
Thanks for any advice.
You can still have both .svc file and the route-based activation, for the same service class, so the requests for both addresses would cause the service to be invoked. The endpoint from the .svc would be defined either using the Factory attribute on the <%@ ServiceHost %> directive or via web.config, and the endpoint from the route (svc-less) would be defined using the factory registered with the ServiceRoute.
精彩评论