My current config looks like so:
Do what the error says... fix your binding
<services>
<service name="service" behaviorConfiguration="serviceBehavior">
<endpoint address="" binding="webHttpBinding"
bindingConfiguration="https"
contract="IContract" behaviorConfiguration="endpointBehavior">
</endpoint>
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="https" maxReceivedMessageSize="65536">
<security mode="Transport" />
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
</bindings>
Try this
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
<!--Set limit to 5 megabytes-->
<standardEndpoint helpEnabled="true" automaticFormatSelectionEnabled="true" maxReceivedMessageSize="5242880">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</standardEndpoint>
<security mode="Transport" />
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
The accepted answer did not work for me because I needed to keep my standard endpoints element. I was able to remove my http-binding and only leave the https-binding in IIS by adding a <webHttpBinding>
section to my Web.config
Make sure to not set the name
property on the <binding>
, otherwise this will not work
Relevant part of my Web.config:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<bindings>
<webHttpBinding>
<binding>
<!-- Comment out the following line if HTTP is used. If HTTPS is used, leave it enabled -->
<security mode="Transport"/>
</binding>
</webHttpBinding>
</bindings>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="false" automaticFormatSelectionEnabled="true"/>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>