gpt4 book ai didi

wcf - 如何在WCF中修复 “could not find a base address that matches schema http”…

转载 作者:行者123 更新时间:2023-12-03 08:24:48 25 4
gpt4 key购买 nike

我正在尝试将WCF服务部署到托管在IIS中的服务器。自然,它可以在我的机器上工作:)

但是当我部署它时,出现以下错误:

This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.



对此进行谷歌搜索,我发现我必须将serviceHostingEnvironment元素放入web.config文件中:
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://mywebsiteurl"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>

但是一旦完成此操作,我将得到以下信息:

Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https].



似乎不知道基址是什么,但是如何指定它呢?这是我的web.config文件的相关部分:
<system.serviceModel>
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://mywebsiteurl"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>

<behaviors>
<serviceBehaviors>
<behavior name="WcfPortalBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IWcfPortal"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
receiveTimeout="00:10:00" sendTimeout="00:10:00"
openTimeout="00:10:00" closeTimeout="00:10:00">
<readerQuotas maxBytesPerRead="2147483647" maxArrayLength="2147483647"
maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>

<services>
<service behaviorConfiguration="WcfPortalBehavior" name="Csla.Server.Hosts.Silverlight.WcfPortal">
<endpoint address="" binding="basicHttpBinding" contract="Csla.Server.Hosts.Silverlight.IWcfPortal"
bindingConfiguration="BasicHttpBinding_IWcfPortal">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>

谁能阐明正在发生的事情以及如何解决它?

最佳答案

尝试将安全模式从“传输”更改为“无”。

      <!-- Transport security mode requires IIS to have a
certificate configured for SSL. See readme for
more information on how to set this up. -->
<security mode="None">

关于wcf - 如何在WCF中修复 “could not find a base address that matches schema http”…,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/872151/

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