【发布时间】:2017-07-27 21:36:12
【问题描述】:
我遇到了一个问题,我的 WCF REST 服务似乎没有元数据。这使我无法使用 WCF 测试客户端。
服务的其余部分似乎可以正确构建和生成服务定义。这是我的 web.config。我在这里想念什么?任何建设性的意见将不胜感激。
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<connectionStrings>
<clear />
<add name="Requests" connectionString="REMOVED" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<services>
<service name="Requests.Requests" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="webHttpBinding" contract="Requests.IRequests" bindingConfiguration="WebBinding" behaviorConfiguration="EndpointBehavior" />
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="WebBinding">
<security mode="None" />
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="EndpointBehavior">
<webHttp helpEnabled="true" defaultOutgoingResponseFormat="Json" automaticFormatSelectionEnabled="true" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
【问题讨论】:
标签: c# wcf rest web-config