gpt4 book ai didi

wcf - ChannelFactory.Endpoint 上的 Address 属性为 null。 ChannelFactory 的端点必须具有指定的有效地址

转载 作者:行者123 更新时间:2023-12-04 10:22:14 56 4
gpt4 key购买 nike

我收到以下错误,我不确定我做错了什么。有没有人看到任何明显的东西?下面是我的项目的 Web.config 和我的 WCF 类库的 App.config

The Address property on ChannelFactory.Endpoint was null. The ChannelFactory's Endpoint must have a valid Address specified.



服务器上的 APP.CONFIG(在我的类库中)
<system.serviceModel>
<services>
<service behaviorConfiguration="Default" name="Trezoro.WebAPI.Trade.TradeService">
<endpoint address="" behaviorConfiguration="WebEPBehavior" binding="webHttpBinding"
contract="ITradeService" name="WebHttpBinding_ITradeService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/tradeservice/" />
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="Default" name="Trezoro.WebAPI.Authentication.AuthService">
<endpoint address="" behaviorConfiguration="WebEPBehavior" binding="webHttpBinding"
contract="IAuthService" name="WebHttpBinding_IAuthService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8081/authservice" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="WebEPBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="Default">
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>

WEB项目中的WEB.CONFIG
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />

<bindings>
<customBinding>
<binding name="WebHttpBinding_IAuthService">
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
</binding>
<binding name="WebHttpBinding_ITradeService">
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
</binding>

</customBinding>
</bindings>
<client>
<endpoint binding="customBinding" bindingConfiguration="WebHttpBinding_IAuthService"
contract="IAuthService" name="WebHttpBinding_IAuthService" />
<endpoint binding="customBinding" bindingConfiguration="WebHttpBinding_ITradeService"
contract="ITradeService" name="WebHttpBinding_ITradeService" />
</client>
</system.serviceModel>

最佳答案

您的客户端端点缺少地址。

关于wcf - ChannelFactory.Endpoint 上的 Address 属性为 null。 ChannelFactory 的端点必须具有指定的有效地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1428715/

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