1 HTTP绑定
<system.serviceModel>
<bindings>
<basicHttpBinding>
<!--对应<endpoint address="" binding="basicHttpBinding"-->
<binding name="bindingConfig" closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<!--第2处修改:None-->
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="TestBehaviors" name="SyncMsgServer.CallbackMsgService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="bindingConfig" name="Endpoint1" contract="SyncMsgServer.ICallbackMsgService">
<identity>
<!--第1处修改原来为:localhost,更改为公网IP111.17.168.98,现改为:http://tanzhen.cddlg.com/Service.svc-->
<dns value="111.17.168.98" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" name="Endpoint2" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://cj.cddlg.com/CallbackMsgService.svc" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="TestBehaviors">
<!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false 并删除上面的元数据终结点 -->
<serviceMetadata httpGetEnabled="true"/>
<!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息-->
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceThrottling maxConcurrentCalls="1000" maxConcurrentSessions="1000" maxConcurrentInstances="1000" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
2 TCP绑定
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="metadataBehavior">
<serviceMetadata httpGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="netTcpBindingConfiguration">
<readerQuotas maxDepth="64" maxStringContentLength="2147483647 " maxArrayLength="2147483647 " maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
</security>
</binding>
</netTcpBinding>
</bindings>
<services>
<service name="Services.MyService" behaviorConfiguration="metadataBehavior">
<endpoint address="MyService" binding="netTcpBinding" contract="Contracts.IService" bindingConfiguration="netTcpBindingConfiguration" />
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9999/"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>