12,162
社区成员
发帖
与我相关
我的任务
分享
<system.serviceModel>
<services>
<service behaviorConfiguration="mySb" name="MyService.Service1">
<endpoint address="" behaviorConfiguration="myEb" binding="webHttpBinding" bindingConfiguration="webBind" contract="MyService.IService1">
<identity>
<certificate />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" name="mex" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="mySb">
<!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false -->
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
<!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 -->
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceCredentials>
<serviceCertificate storeName="My" x509FindType="FindBySubjectName" findValue="certnew" storeLocation="LocalMachine"/>
<clientCertificate >
<authentication certificateValidationMode="Custom" customCertificateValidatorType="WCFService.CustomX509CertificateValidator,WCFService"/>
</clientCertificate>
</serviceCredentials>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="myEb">
<webHttp helpEnabled="true" automaticFormatSelectionEnabled="true"/>
<clientCredentials>
<clientCertificate storeName="My" x509FindType="FindBySubjectName" findValue="certnew" storeLocation="CurrentUser"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="webBind" openTimeout="00:10:00" receiveTimeout="00:10:00" closeTimeout="10:10:00" sendTimeout="00:10:00" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647"/>
<security mode="Transport">
<transport clientCredentialType="None"></transport>
</security>
</binding>
</webHttpBinding>
<customBinding>
<binding name="JsonMapper">
<webMessageEncoding webContentTypeMapperType="Microsoft.Ajax.Samples.JsonContentTypeMapper, JsonContentTypeMapper"/>
<httpTransport manualAddressing="true"/>
</binding>
</customBinding>
</bindings>
<protocolMapping>
<add binding="webHttpBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>