找不到与绑定WSHttpBinding的端点的方案https匹配的基址

时间:2014-02-20 11:52:59

标签: asp.net wcf iis wshttpbinding

我在本地项目中运行WCF应用程序时遇到错误。它在iis中工作正常。请帮我解决这个问题。这是我的错误。无法找到与绑定WSHttpBinding的端点的方案https匹配的基址。注册的基地址方案是[http]。

<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviour">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceCredentials>
            <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="HelpDeskAdaptor.CustomValidator,HDAdaptorService" />
          </serviceCredentials>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <wsHttpBinding>
        <binding name="SafeServiceConf" maxReceivedMessageSize="65536">
          <readerQuotas maxStringContentLength="65536" maxArrayLength="65536" maxBytesPerRead="65536" />
          <security mode="TransportWithMessageCredential">
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="ServiceBehaviour" name="HelpDeskAdaptor.HDAdaptorService">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="SafeServiceConf" name="wsHttpBinding" contract="HelpDeskAdaptor.IHDAdapterService.cs">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
      </service>
    </services>
  </system.serviceModel>

1 个答案:

答案 0 :(得分:1)

Threre是您的托管环境与服务配置之间的不匹配。由于Security / Mex,此配置需要https,并且只有http可用 这取决于您的背景,但您有两个选择:

  • 在IIS中创建https绑定

  • 将您的服务配置更改为在http
  • 下运行

从配置中删除此行

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>

并将安全配置更改为

   <security mode="None">