【发布时间】:2015-01-20 12:27:41
【问题描述】:
我正在使用 asp.net mvc 和 wcf rest。 我在 asp.net mvc 中托管了休息服务。 和配置文件看起来像这样
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="false"/>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
和 global.ascx
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RouteTable.Routes.Add(new ServiceRoute("Rest", new WebServiceHostFactory(), typeof(Rest)));
RegisterRoutes(RouteTable.Routes);
}
可以使用 http 或 https 访问我的 asp.net Web 应用程序。 但我想仅在 https 中使用 rest api 如何禁用 wcf rest api 的 http 协议。 我没有 .svc 文件。
【问题讨论】:
标签: c# asp.net asp.net-mvc wcf rest