使用 web.config 配置 wcf webapi
我当前正在配置现有的 WCF SOAP Web 服务以使用 WebApi 进行访问
我已添加 WebApi 属性,并将以下代码添加到 global.asax 中:
RouteTable.Routes.SetDefaultHttpConfiguration(new WebApiConfiguration() { EnableTestClient = true });
RouteTable.Routes.MapServiceRoute<Contacts>("api/contacts/");
是否可以使用 web.config 而不是这些行来配置 webapi?
I'm currently configuring an existing WCF SOAP webservice to be accessible using WebApi
I have added the WebApi attributes, and the following code into global.asax:
RouteTable.Routes.SetDefaultHttpConfiguration(new WebApiConfiguration() { EnableTestClient = true });
RouteTable.Routes.MapServiceRoute<Contacts>("api/contacts/");
Is it possible to configure webapi using the web.config instead of these lines?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是不可能的,但是使用 WCF 内置的可扩展性点也不是不可能实现。
This is not possible out of the box, however it's not impossible to achieve using the extensability points built into WCF.