首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >https与webHttpBinding的问题

https与webHttpBinding的问题
EN

Stack Overflow用户
提问于 2012-07-17 19:15:00
回答 1查看 5.4K关注 0票数 2

我在用webHttpBinding实现https时遇到了问题。我得到了以下错误

找不到与具有绑定WebHttpBinding的终结点的方案https匹配的基地址。注册的基址方案是http

下面是我的web.config代码。请帮帮忙

代码语言:javascript
复制
<system.serviceModel>
<bindings>
  <webHttpBinding>
    <binding name="webHttpMobile" maxReceivedMessageSize="2147483647">
      <security mode="Transport">
        <transport clientCredentialType="None" />
      </security>
      <readerQuotas maxStringContentLength="2147483647" />
    </binding>
  </webHttpBinding>
</bindings>
<services>

  <service behaviorConfiguration="mybehavior"          name="SoIn.Services.MobileWebRole.Command">
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding"    bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.ICommand" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
  <service behaviorConfiguration="mybehavior" name="SoIn.Services.MobileWebRole.Query">
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.IQuery" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
  <service behaviorConfiguration="mybehavior" name="SoIn.Services.MobileWebRole.Configuration">
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.IConfiguration" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
  <endpointBehaviors>
    <behavior name="web">
      <webHttp />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="mybehavior">
      <serviceMetadata  httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-07-17 19:29:52

尝试下面提到的配置。

代码语言:javascript
复制
<system.serviceModel>
<bindings>
  <webHttpBinding>
    <binding name="webHttpMobile" maxReceivedMessageSize="2147483647">
      <security mode="Transport">
        <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
      <readerQuotas maxStringContentLength="2147483647" />
    </binding>
  </webHttpBinding>
</bindings>
<services>

  <service behaviorConfiguration="mybehavior"          name="SoIn.Services.MobileWebRole.Command">
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding"    bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.ICommand" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
  <service behaviorConfiguration="mybehavior" name="SoIn.Services.MobileWebRole.Query">
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.IQuery" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
  <service behaviorConfiguration="mybehavior" name="SoIn.Services.MobileWebRole.Configuration">
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpMobile" contract="SoIn.Services.MobileWebRole.IConfiguration" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
  <endpointBehaviors>
    <behavior name="web">
      <webHttp />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="mybehavior">
      <serviceMetadata  httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11521326

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档