gpt4 book ai didi

WCF - "There was no endpoint listening at..."错误

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

我有两个应用程序要在同一台机器上进行本地测试。应用程序 1 有一个简单的 WCF 服务,其中包含以下配置条目:

<service behaviorConfiguration="MyNamespace.ContainerManagementServiceBehavior"
name="MyNamespace.ContainerManagementService">
<endpoint address="ContainerManagementService" binding="basicHttpBinding"
name="ContainerManagementbasicHttpEndpoint"
contract="MyNamespace.IContainer" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/ContainerManagementService" />
</baseAddresses>
</host>
</service>
<behaviors>
<behavior name="MyNamespace.ContainerManagementServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</behaviors>

我通过运行托管它的 Web 应用程序项目来启动该服务。我能够成功浏览到 url 并从 ie 获取 Web 服务信息页面。我复制了相同的 URL 并将其用于我的客户端。

我的另一个客户端 App 2 在其配置文件中包含以下内容:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttp" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00"
sendTimeout="00:10:00" allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="5242880" maxBufferPoolSize="524288"
maxReceivedMessageSize="5242880" messageEncoding="Text"
textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="5242880" />
<security mode="None">
<transport clientCredentialType="None"
proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint
address="http://localhost:3227/Services/ContainerManagementService.svc"
binding="basicHttpBinding" bindingConfiguration="basicHttp"
contract="MyService.IService" name="externalService" />
</client>
</system.serviceModel>

但是,当我尝试对正在运行的服务执行 WCF 调用表单客户端时,我收到以下错误消息:
There was no endpoint listening at
http://localhost:3227/Services/ContainerManagementService.svc
that could accept the message. This is often caused by an incorrect
address or SOAP action. See InnerException, if present, for more details.

会发生什么?

最佳答案

看起来问题是由于服务器和客户端都从 Cassini 服务器运行。我正在更改架构以在 IIS 中托管服务器端点。

关于WCF - "There was no endpoint listening at..."错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5463547/

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