eat-sleep-code eat-sleep-code - 1 year ago 135
C# Question

Missing MetaData In WCF Service

I am running into an issue where my WCF REST service does not seem to have metadata. This prevents me from using the WCF Test Client.

The rest of the service appears to build and generate the service definitions correctly. Here is my web.config. What am I missing here? Any constructive input would be greatly appreciated.

<?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>

Answer Source

WCF REST services doesn't use metadata, it's available for SOAP only. Try to use fiddler or other similar tool as a test client

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download