WCF – HttpGetEnabled property of ServiceMetadataBehavior Error

October 16, 2009 at 3:08 PMRampidByter

Added SSL recently to our production WCF service site. The big change happened when trying to setup a customer feed to begin testing implementations against the fixed service location. After setting the site to require SSL a particular friendly yellow-screen-of-death appeared with the following message The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, but there is no http base address.  Either supply an http base address or set HttpGetUrl to an absolute address.”

The fix is to change the httpGetEnabled=”true” to httpsGetEnabled=”true” under serviceMetadata tag for the defined service behavior settings. A simple little s character cost an hour of time in configuration to find. There was another one similar when changing the IMetadataExchange endpoint to use mexHttpsBinding instead of mexHttpBinding. That was another topic all together but very related as far as the fix. Below you’ll find a snippet of the configuration section with https changes.

 1:  <behaviors>
 2:  <serviceBehaviors>
 3:  <behavior name="Services.ServiceBehavior">
 4:  <serviceCredentials>
 5:  <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Services.Validators.UserValidator, Services"/>
 6:  </serviceCredentials>
 7:  <serviceMetadata httpsGetEnabled="true" />
 8:  <serviceDebug includeExceptionDetailInFaults="false" />
 9:  </behavior>
 10:  </serviceBehaviors>
 11:  </behaviors>

Posted in: .Net | Programming | WCF

Tags: