Search code examples
metadatawcf-data-services

Securing WCF Data Services Metadata


I have a WCF Data Service (5.6) running in a Webrole in an azure cloud service. I do not want to disclose the metadata, however regardless of how I set the behavior it still returns the metadata.

this is the snippet from the web.config

<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false before deployment -->
          <serviceMetadata httpGetEnabled="false"  httpsGetEnabled="false" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  
               Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

...

Any help is greatly appreciated

Alberto


Solution

  • If you don't want to expose the metadata, try removing the <serviceMetadata> node altogether.