12,166
社区成员




<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<!-- 部署服务库项目时,必须将配置文件的内容添加到
主机的 app.config 文件中。System.Configuration 不支持库的配置文件。-->
<system.serviceModel>
<services>
<service name="WcfServiceLibrary.Service1" behaviorConfiguration="WcfServiceLibrary.Service1Behavior">
<host>
<baseAddresses>
<add baseAddress = "https://localhost:9001" />
</baseAddresses>
</host>
<!-- Service Endpoints -->
<!-- 除非完全限定,否则地址将与上面提供的基址相关 -->
<endpoint address ="Service1" binding="wsHttpBinding" contract="WcfServiceLibrary.IService1" bindingConfiguration="WcfServiceLibrary.Service1Binding" />
<!-- Metadata Endpoints -->
<!-- 元数据交换终结点由服务用于向客户端做自我描述。-->
<!-- 此终结点不使用安全绑定,应在部署前确保其安全或将其删除-->
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WcfServiceLibrary.Service1Behavior">
<!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false 并删除上面的元数据终结点-->
<serviceMetadata httpGetEnabled="true"/>
<!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息-->
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceCredentials>
<serviceCertificate storeName="My" x509FindType="FindBySubjectName" findValue="WCFServerPK" storeLocation="LocalMachine"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="WcfServiceLibrary.Service1Binding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
<serviceCredentials>
<serviceCertificate storeName="WCFServerPK保存位置" findValue="WCFServerPK的Hash" storeLocation="LocalMachine" x509FindType="FindByThumbprint"/>
</serviceCredentials>
<clientCredentials>
<clientCertificate findValue="WCFClientPK的Hash" storeLocation="LocalMachine" storeName="WCFServerPK保存位置" x509FindType="FindByThumbprint"/>
</clientCredentials>