gpt4 book ai didi

wcf 提供的 URI 方案 'http' 无效;预期 'https'

转载 作者:行者123 更新时间:2023-12-04 17:54:54 44 4
gpt4 key购买 nike

我想根据这个 post 创建文件传输

当我在本地测试它时,它工作得很好

我使用没有 ssl 的 iis 在服务器上设置我的服务

这是我的服务器配置:

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/>
<bindings>
<wsHttpBinding>
<binding name="TransferService" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>

<services>
<service behaviorConfiguration="TransferServiceBehavior" name="WcfFTP.FtpService">
<endpoint address="FtpService.svc" binding="wsHttpBinding" bindingConfiguration="TransferService" contract="WcfFTP.IFileTransfer"/>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="TransferServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="500" maxConcurrentSessions="500" maxConcurrentInstances="500"/>
</behavior>
</serviceBehaviors>
</behaviors>

那是我的客户:
 <system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IFileTransfer" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />

<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Digest" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://www.myhost.com/WsFTP/FtpService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IFileTransfer"
contract="FtpWcfClient.IFileTransfer" name="WSHttpBinding_IFileTransfer" />
</client>

我一直在网上寻求有关此安全问题的帮助,但此错误似乎很奇怪

最佳答案

客户端和服务器的绑定(bind)配置不兼容。服务器未指定安全性,但客户端指定了 TransportWithMessageCredential。您可以将客户端配置中的安全模式设置为无。

我强烈建议您使用WCF configuration editor也可以避免许多常见错误,例如拼写错误、不匹配绑定(bind)等。

关于wcf 提供的 URI 方案 'http' 无效;预期 'https',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9859153/

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