Wcf [url]上没有可接受消息的侦听端点
我看到网络上有几个类似的话题,关于这一点,但是没有一个对我解决这个问题有帮助 我有一个wcf服务,它由IIS中的同一个web应用程序托管和使用(不要问为什么)。 所以我的web.config看起来像这样Wcf [url]上没有可接受消息的侦听端点,wcf,Wcf,我看到网络上有几个类似的话题,关于这一点,但是没有一个对我解决这个问题有帮助 我有一个wcf服务,它由IIS中的同一个web应用程序托管和使用(不要问为什么)。 所以我的web.config看起来像这样 <system.serviceModel> <services> <service name="Management.Service.ManagementService" behaviorConfiguration="Management.S
<system.serviceModel>
<services>
<service name="Management.Service.ManagementService" behaviorConfiguration="Management.Service.ManagementServiceBehavior">
<endpoint name="default" binding="basicHttpBinding" bindingConfiguration="default" contract="Management.Service.IManagementService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Management.Service.ManagementServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<bindings>
<basicHttpBinding>
<binding name="default" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="true" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://www.example.com/Service.svc"
binding="basicHttpBinding" bindingConfiguration="default"
contract="Management.Client.IManagementService" name="default" />
</client>
</system.serviceModel>
编辑:忘了提一下,如果我尝试使用本地环境的生产服务,效果很好 事实证明,这是一个完全不同的问题。
事实证明,web应用程序(实际上是服务)可以从服务器本身访问,也就是说,如果我尝试从服务器本身浏览站点,我会收到一条“未找到页面”消息。我也有同样的问题。在我的情况下,我打电话的服务器有防火墙问题。他们没有打开防火墙。他们打开后,问题就解决了。为什么要在同一个过程中托管服务和消费者?这毫无意义。@hugh-好吧,这就是为什么-我有同一个web应用程序的多个实例,它们服务于不同的组织。所涉及的服务公开其运行所在实例的某些数据(这些数据可能因实例而异)。每个实例都知道在其他实例中运行的其他服务(服务的url存储在数据库中)。web应用程序中有一个特定的模块,它基本上从它知道的所有服务中获取数据并显示数据。因此,基本上目的是显示相关组织的数据。那么,您的每个服务都运行在不同的w3wp.exe实例中?每个web应用程序的客户端也只调用在不同w3wp进程中运行的服务?@hugh-Yes。每个web应用程序都有自己的服务运行。每个web应用程序都可以知道一个或多个其他服务并从中获取数据。
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true" >
<listeners>
<add name="xml"/>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="xml"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="C:\inetpub\WcfClient.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="xml"/>
</sharedListeners>
</system.diagnostics>