gpt4 book ai didi

HTTPS 上的 WCF 生成 "The provided URI scheme ' https' 无效;预期为 'http'。”

转载 作者:太空宇宙 更新时间:2023-11-03 12:56:06 24 4
gpt4 key购买 nike

我一直在谷歌搜索我可能找到的所有地方(包括 Stackoverflow 上的此处)以找出一个错误我试图将 WCF 服务部署到 Windows 7 x64 上的 IIS 7.5,该服务仅通过具有基本 HTTP 身份验证的 SSL 运行。我在 IIS 中有一个站点,它使用自签名证书绑定(bind)到 HTTPS 的端口 50443。 (我不能使用标准端口 443,因为我们计划将其部署到已经运行 Tomcat 的服务器上的 IIS,该服务器正在监听 80 和 443。)

这是 web.config:

<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="SSLBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="HelloWorldWcf.HelloWorldWcfService">
<endpoint name="HelloWorldWcf.HelloWorldWcfService"
address="https://mylaptop:50443/HelloWorld/Service1.svc"
binding="basicHttpBinding"
bindingConfiguration="SSLBinding"
contract="HelloWorldWcf.IHelloWorldWcfService"/>
<endpoint address="https://mylaptop:50443/HelloWorld/Service1.svc/mex"
binding="mexHttpsBinding"
contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>

如果我浏览到服务端点地址并手动输入基本身份验证凭据,我的浏览器中会显示以下异常错误消息:

The provided URI scheme 'https' is invalid; expected 'http'.
Parameter name: context.ListenUriBaseAddress

这与我尝试针对类似服务运行 WCF 客户端时遇到的错误相同,除了它以“Parameter name: via”结尾(因为调用堆栈中显示的方法的参数名称,“System .ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(URI via)",实际上是"via")。

我已经多次调整服务器和客户端配置文件,但我已经忘记了,但上面的 web.config 文件是我迄今为止最好的猜测——它甚至不能在浏览器中运行,更不用说了WCF 客户端。

要通过 HTTPS 通过基本 HTTP 身份验证在非标准 SSL 端口上访问 IIS 7.5 中托管的 WCF 服务,我需要做什么?帮助! (谢谢!)

最佳答案

尝试将其添加到绑定(bind)中

<security mode="Transport"> 
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Certificate" algorithmSuite="Default" />
</security>

关于HTTPS 上的 WCF 生成 "The provided URI scheme ' https' 无效;预期为 'http'。”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11512969/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com