1. Pay special attention to the binding name= "bindingbehaviorconfiguration" ( name can be arbitrarily taken, but must be consistent between the server and the client )
bindingconfiguration= "bindingbehaviorconfiguration"
How to not configure consistency: The server has denied client credentials
If there is no configuration: Security mode= "None", the behavior occurs: The server has denied client credentials
----Server-side Configuration example:
<?xml version= "1.0" encoding= "Utf-8"?>
<configuration>
<startup>
<supportedruntime version= "v4.0" sku= ". netframework,version=v4.5 "/>
</startup>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name= "bindingbehaviorconfiguration"Maxbufferpoolsize=" 52428800 "
Maxbuffersize= "6553600" maxreceivedmessagesize= "6553600" portsharingenabled= "true" >
<readerquotas maxstringcontentlength= "6553600"/>
<security mode= "None"/>
</binding>
</netTcpBinding>
</bindings>
<services>
<service name= "CDAgentWCF.Services.CDAgentWCFService" behaviorconfiguration= " CDAgentWCF.Services.CDAgentWCFServiceBehavior ">
<baseAddresses>
<add baseaddress= "NET.TCP://LOCALHOST:9999/CDAGENTWCF"/>
<add baseaddress= "Http://localhost:9998/CDAgentWCF"/>
</baseAddresses>
<endpoint address= "Propellingservice"
Binding= "NetTcpBinding"
contract= "CDAgentWCF.Services.ICDAgentWCFService" bindingconfiguration= "bindingbehaviorconfiguration"/>
<endpoint address= "Mex"
Binding= "mexHttpBinding"
contract= "IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name= "CDAgentWCF.Services.CDAgentWCFServiceBehavior" >
<servicemetadata httpgetenabled= "True"/>
<servicedebug includeexceptiondetailinfaults= "False"/>
<datacontractserializer maxitemsinobjectgraph= "2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Client Configuration instance:
<?xml version= "1.0" encoding= "Utf-8"?>
<configuration>
<startup>
<supportedruntime version= "v4.0" sku= ". netframework,version=v4.5 "/>
</startup>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name= "bindingbehaviorconfiguration">
<security mode= "None"/>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address= "Net.tcp://192.168.1.88:9999/cdagentwcf/propellingservice"
Binding= "NetTcpBinding"
contract= "Cdagentservice.cdagentwcfservice" bindingconfiguration= "bindingbehaviorconfiguration">
</endpoint>
</client>
<behaviors>
<endpointBehaviors>
<behavior>
<datacontractserializer maxitemsinobjectgraph= "2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
WCF transmits data between server-side servers and client servers through the net TCP protocol, noting configuration considerations