Previous Topic

Next Topic

Book Contents

WCF—Enabling and disabling metadata

By default, WCF services do not publish the metadata. If you want the configuration to allow access to the metadata through the use of import tools such as svcUtil.exe to generate the client code, you must explicitly set the following in the web.config file:

<serviceBehaviors>

<behavior name="PhaseForward.InForm.Wcf.ODMSubmit.ODMSubmitServiceBehavior">

<serviceMetadata httpGetEnabled="true" />

<serviceDebug includeExceptionDetailInFaults="true" />

</behavior>

After successfully developing and deploying the client, set the values to false, which prevents unwanted clients from generating proxy files or looking at potentially sensitive information.

<serviceBehaviors>

<behavior name="PhaseForward.InForm.Wcf.ODMSubmit.ODMSubmitServiceBehavior">

<serviceMetadata httpGetEnabled="false" />

<serviceDebug includeExceptionDetailInFaults="false" />

</behavior>

If you do not need to publish metadata, leave the setting turned off.

Send Feedback