【发布时间】:2011-10-14 08:00:02
【问题描述】:
我在本地计算机上使用 wcf 用户名/密码身份验证,使用自签名证书,一切正常,但是当我将应用程序放在 IIS 7.5 和 windows server 2008 R2 上时,它给了我错误:
找不到与绑定 WSHttpBinding 的端点的方案 http 匹配的基地址。注册的基地址方案是 [https]。
我的网络服务配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceCredentialsBehavior">
<serviceCredentials>
<serviceCertificate findValue="cn=AmicCert" storeName="Root" storeLocation="LocalMachine" />
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Util.CustomUserNameValidator, Util" />
</serviceCredentials>
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="ServiceCredentialsBehavior" name="Service">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="MessageAndUserName" name="SecuredByTransportEndpoint" contract="IService" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="MessageAndUserName">
<security mode="Message">
<message clientCredentialType="UserName" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client />
</system.serviceModel>
<system.web>
<compilation debug="true" />
</system.web>
</configuration>
【问题讨论】:
-
它对我有用 address="mex" stackoverflow.com/questions/7285717/…