所提供的URI方案';https';无效;预期';http';.参数获取Via-API

本文关键字:http 预期 参数 获取 Via-API 无效 https 方案 URI | 更新日期: 2023-09-27 18:05:46

Iam正在尝试通过https为基于basicHttpBinding的api创建WCF服务。我的web.config

 <bindings>
  <customBinding>
    <binding name="ServiceComPortBinding" receiveTimeout="02:00:00"
       sendTimeout="02:00:00"
       openTimeout="02:00:00"
       closeTimeout="02:12:00">
      <transactionFlow transactionProtocol="WSAtomicTransactionOctober2004"/>
      <security defaultAlgorithmSuite="Basic128" authenticationMode="UserNameForCertificate" requireDerivedKeys="false" securityHeaderLayout="Strict" includeTimestamp="true" keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncrypt" messageSecurityVersion="WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10" requireSignatureConfirmation="false">
        <localClientSettings cacheCookies="true" detectReplays="true" replayCacheSize="900000" maxClockSkew="01:00:00" maxCookieCachingTime="Infinite" replayWindow="01:00:00" sessionKeyRenewalInterval="10:00:00" sessionKeyRolloverInterval="01:0:00" reconnectTransportOnFailure="true" timestampValidityDuration="01:00:00" cookieRenewalThresholdPercentage="60"/>
        <localServiceSettings detectReplays="true" issuedCookieLifetime="10:00:00" maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="01:00:00" negotiationTimeout="01:00:00" replayWindow="01:01:00" inactivityTimeout="01:00:00" sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="01:00:00" reconnectTransportOnFailure="true" maxPendingSessions="128" maxCachedCookies="10000" timestampValidityDuration="01:00:00"/>
        <secureConversationBootstrap/>
      </security>
      <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap11WSAddressing10" writeEncoding="utf-8">
        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
      </textMessageEncoding>
      <httpTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true">
        <extendedProtectionPolicy policyEnforcement="Never"/>
      </httpTransport>
    </binding>
  </customBinding>
</bindings>

设置有问题吗。将一个异常作为"提供的URI方案'https'无效;应为'http'。参数名称:via">

所提供的URI方案';https';无效;预期';http';.参数获取Via-API

由于服务在HTTPS上运行,<httpTransport>上述配置中的标记应更改为<httpsTransport>。请执行更改,然后重试。