WCF--找不到具有绑定 BasicHttpBinding 的终结点的与方案 https 匹配的基址。注册的基址方案是 [http]。...

本文详细介绍了如何在WCF服务中配置基本HTTP绑定的基本参数,包括消息大小限制、配额和安全模式等,并通过实例展示了如何修改安全模式来解决特定问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  <system.serviceModel>
    <services>
      <service name="xxxxx.xxxxxx">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="aHttpBinding" contract="xxxxx.xxxxxx" name="xxxxx.xxxxx"></endpoint>
      </service>
    </services>
    <bindings>
      <basicHttpBinding>

        <binding name="aHttpBinding" maxReceivedMessageSize="1000000">
          <readerQuotas maxStringContentLength="1000000" />
          <security mode="Transport"> <!---------------------------------------------此处改为None----------------------->
          <transport clientCredentialType="None"/> 
        </security> 
        </binding>

      </basicHttpBinding>
    </bindings>

    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false -->
          <serviceMetadata httpsGetEnabled="false" />
          <!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 -->
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

原因不知道为什么,把mode改为None就可以

转载于:https://www.cnblogs.com/25miao/p/8319077.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值