繁体   English   中英

找不到与绑定WSHttpBinding的端点的scheme http匹配的基址

[英]Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding

我在我的本地计算机上进行了用户名/密码验证,使用自签名证书,一切正常,但是当我将我的应用程序放在IIS 7.5和Windows Server 2008 R2上时,它给了我错误:

找不到与绑定WSHttpBinding的端点的scheme http匹配的基址。 注册的基地址方案是[https]。 我的网络服务cfg:

<?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>

听起来您托管的IIS网站实例仅配置为HTTPS(SSL)。 右键单击网站实例,然后选择“编辑绑定...”。 你看到那里列出了端口80(普通HTTP)吗? 同时检查“SSL设置”功能,确保未启用“始终需要”选项。

如果您不想为端点使用HTTPS / SSL,则Drew的答案是正确的。

如果您确实想在端点上使用SSL,则需要更改以下内容:

<security mode="Message">

至:

<security mode="TransportWithMessageCredential">

要使其工作并且仍然要求IIS需要SSL,您需要在配置文件中对端点进行一些更改:使用https( https://... )和listenUri属性将address属性设置为服务的地址使用http( http://... )访问服务的地址。 这适用于wsHttpbasicHttp

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM