Something new in WCF 4.0
Comparing with WCF 3.x, WCF 4.0 has new features. for example:
default endpoints:
With WCF 3.x, you have to provide configured endpoints when you host a service, otherwise, you will get an exception. In WCF 4, you will not worried if you forgot to set endpoint, because the runtime automatically adds one or more "default endpoints" for you.
Default Binding Configurations
In WCF 3.x, we define a named binding configuration through the bindingConfiguration attribute :
(the sample is from MSDN blog)
The following content copied from MSDN also.
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicWithMtom" messageEncoding="Mtom"/>
</basicHttpBinding>
</bindings>
<services>
<service name="GreetingService">
<endpoint address="mtom" binding="basicHttpBinding"
bindingConfiguration="BasicWithMtom"
contract="IHello"/>
</service>
</services>
</system.serviceModel>
</configuration>
In the above example, the "BasicWithMtom" binding configuration overrides the defaults for the BasicHttpBinding by changing the message encoding to MTOM. …With WCF 4, you can now define default binding configurations by simply omitting the binding configuration name when defining the new configuration. Then WCF will use that default configuration for any endpoints using that binding that don’t have an explicit binding configuration set on them.
For example, if we add the following app.config file to the console application shown earlier, the two default HTTP endpoints will pick up this default BasicHttpBinding configuration, which enables MTOM:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding messageEncoding="Mtom"/> <!-- notice there’s no name attribute -->
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
About more information, please read "A Developer's Introduction to Windows Communication Foundation 4".