开发者

WCF 4.0 - How to route old service URL to new service URL?

开发者 https://www.devze.com 2023-03-10 01:46 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号