IIS 7.5 WCF Error: The … does not have a Binding with the None MessageVersion.

Error

I received the following error while trying to run a WCF application built in Visual Studio 2013 running on a Windows 8 IIS 7.5 server.

The … does not have a Binding with the None MessageVersion. ‘System.ServiceModel.Description.WebHttpBehavior’ is only intended for use with WebHttpBinding or similar bindings.

Solution

With help from http://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx and http://stackoverflow.com/questions/7585363/why-does-my-wcf-service-give-the-message-does-not-have-a-binding-with-the-none, I edited my web.config file and added/changed it to include the bolded text. Basically, I was confusing SOAP and REST calls. The below is utilized for REST only, SOAP requires the basicHttpBindings.


<system.serviceModel>
<services>
<service name="XOM.REIT.CNC.ClusterNotificationCenter" behaviorConfiguration="DefaultBehavior">
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="secureHttpBinding" contract="XOM.REIT.CNC.IClusterNotificationCenter" behaviorConfiguration="DefaultEndpointBehavior"/>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="https://localhost:30022/"/>
</baseAddresses>
</host>
</service>
</services>
<bindings>
      <webHttpBinding>
        <binding name="secureHttpBinding">
          <security mode="Transport">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">
            <serviceMetadata httpsGetEnabled="true"/>
            <serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="DefaultEndpointBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.