问题描述
服务端配置<system.serviceModel><services><servicename="KeYun.Services.Service"behaviorConfiguration="WSBehavior"><endpointaddress="mex"binding="mexHttpBinding"contract="IMetadataExchange"/><endpointaddress=""binding="customBinding"bindingConfiguration="MyCustomBinding"contract="KeYun.Services.IService"><identity><dnsvalue="MYWCFCert"/></identity></endpoint></service></services><bindings><!--<wsHttpBinding><bindingname="ClassLineBinding"maxBufferPoolSize="12000000"maxReceivedMessageSize="12000000"useDefaultWebProxy="false"><readerQuotasmaxStringContentLength="12000000"maxArrayLength="12000000"/><securitymode="Message"><transportclientCredentialType="None"/><messageclientCredentialType="UserName"/></security></binding></wsHttpBinding>--><customBinding><bindingname="MyCustomBinding"><transactionFlow/><securityauthenticationMode="UserNameForSslNegotiated"><secureConversationBootstrap><localClientSettingsmaxClockSkew="00:59:00"/><localServiceSettingsmaxClockSkew="00:59:00"/></secureConversationBootstrap><localClientSettingsmaxClockSkew="00:59:00"/><localServiceSettingsmaxClockSkew="00:59:00"/></security><textMessageEncoding><readerQuotasmaxStringContentLength="500000"/></textMessageEncoding><httpTransportmaxReceivedMessageSize="10485760"maxBufferPoolSize="524288"/></binding></customBinding></bindings><behaviors><endpointBehaviors><behaviorname="web"><webHttp/></behavior></endpointBehaviors><serviceBehaviors><behaviorname="WSBehavior"><serviceMetadatahttpGetEnabled="True"/><serviceDebugincludeExceptionDetailInFaults="True"/><serviceCredentials><serviceCertificatefindValue="MYWCFCert"storeLocation="LocalMachine"x509FindType="FindBySubjectName"/><userNameAuthenticationuserNamePasswordValidationMode="Custom"customUserNamePasswordValidatorType="KeYun.Services.CustomUserPassword,KeYun.Services"cacheLogonTokens="false"/></serviceCredentials></behavior></serviceBehaviors></behaviors></system.serviceModel>客户端配置<system.serviceModel><behaviors><endpointBehaviors><behaviorname="myClientBehavior"><clientCredentials><serviceCertificate><authenticationcertificateValidationMode="Custom"customCertificateValidatorType="KeYun.GUI.MyX509Validator,KeYun.GUI"/></serviceCertificate></clientCredentials></behavior></endpointBehaviors></behaviors><bindings><!--<wsHttpBinding><bindingname="WSHttpBinding_IService"maxBufferPoolSize="12000000"maxReceivedMessageSize="12000000"useDefaultWebProxy="false"><readerQuotasmaxStringContentLength="12000000"maxArrayLength="12000000"/><security><messageclientCredentialType="UserName"/></security></binding></wsHttpBinding>--><customBinding><bindingname="MyCustomBinding"closeTimeout="00:01:00"openTimeout="00:01:00"receiveTimeout="00:10:00"sendTimeout="00:01:00"><transactionFlow/><securityauthenticationMode="UserNameForSslNegotiated"><secureConversationBootstrap><localClientSettingsmaxClockSkew="00:59:00"/><localServiceSettingsmaxClockSkew="00:59:00"/></secureConversationBootstrap><localClientSettingsmaxClockSkew="00:59:00"/><localServiceSettingsmaxClockSkew="00:59:00"/></security><textMessageEncoding><readerQuotasmaxStringContentLength="500000"/></textMessageEncoding><httpTransportmaxReceivedMessageSize="10485760"maxBufferPoolSize="524288"/></binding></customBinding></bindings><client><!--<endpointaddress="http://localhost:6565/Service.svc"binding="wsHttpBinding"bindingConfiguration="WSHttpBinding_IService"contract="IService"name="WSHttpBinding_IService"><identity><dnsvalue="MYWCFCert"/></identity></endpoint>--><!--<endpointaddress="http://220.163.6.244:9008/Service.svc"binding="wsHttpBinding"bindingConfiguration="WSHttpBinding_IService"contract="IService"name="WSHttpBinding_IService"behaviorConfiguration="myClientBehavior"><identity><dnsvalue="MYWCFCert"/></identity></endpoint>--><endpointaddress="http://192.168.18.107:8585/Service.svc"binding="customBinding"bindingConfiguration="MyCustomBinding"contract="IService"name="WSHttpBinding_IService"behaviorConfiguration="myClientBehavior"><identity><dnsvalue="MYWCFCert"/></identity></endpoint></client></system.serviceModel>