【发布时间】:2016-12-19 09:00:40
【问题描述】:
您好,我正在使用 WCF、MVC4 和 angularJS 开发小型应用程序。我指的是以下网址
https://code.msdn.microsoft.com/AngularJS-Shopping-Cart-8d4dde90#content
当我尝试在我的 mvc 应用程序中添加服务引用时,出现以下错误
Metadata publishing for this service is currently disabled.
我在下面给出了访问服务的网址。
http://localhost:55835/Service1.svc
当我尝试时,我得到了错误。我无法在我的应用程序中添加服务引用。我有点担心我的 web.config 文件。这是我的 web.config 文件。
<system.web>
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" />
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
</httpModules>
</system.web>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior>
<webHttp helpEnabled="True"/>
</behavior>
</endpointBehaviors>
</behaviors>
<protocolMapping>
<add binding="webHttpBinding" scheme="http" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
有人能告诉我我在配置文件中遗漏了什么吗?
提前谢谢你。
【问题讨论】:
-
将
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>行为添加到您的配置文件中。
标签: c# web-services wcf