See http://www.cnblogs.com/webabcd/archive/2007/12/27/1017081.html
Set baseaddress to HTTP. This can be automatically configured in add service reference.
The http: // localhost: 8731 port and net. TCP: // localhost: 54321 port cannot be the same
<Configuration>
<System. servicemodel>
<Behaviors>
<Servicebehaviors>
<Behavior name = "wcfwinserver. addservicebehavior">
<Servicemetadata httpgetenabled = "true"/>
<Servicedebug includeexceptiondetailinfaults = "false"/>
</Behavior>
</Servicebehaviors>
</Behaviors>
<Services>
<Service behaviorconfiguration = "wcfwinserver. addservicebehavior"
Name = "wcfwinserver. addservice">
<Endpoint address = "net. TCP: // localhost: 54321/binding/Hello" binding = "nettcpbinding" Contract = "wcfwinserver. iaddservice">
<Identity>
<DNS value = "localhost"/>
</Identity>
</Endpoint>
<Endpoint address = "mex" binding = "mexhttpbinding" Contract = "imetadataexchange"/>
<Host>
<Baseaddresses>
<Add baseaddress = "http: // localhost: 8731/design_time_addresses/wcfwinserver/addservice/"/>
</Baseaddresses>
</Host>
</Service>
</Services>
</System. servicemodel>
</Configuration>