2012-12-12 67 views
0

我看到有几个类似的话题在网上和SO关于这个,但他们都没有帮助我解决这个问题。没有端点在[url]监听,可以接受消息

我有一个wcf服务,它由IIS中的同一个web应用程序托管和使用(不要问为什么)。 所以我的web.config看起来像这样

<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> 

这工作在我的本地环境的精绝,我甚至可以浏览到在任何浏览器服务(生产)。但是,当出于某种原因,我的生产服务器上出现There was no endpoint listening错误。

我也尝试在<system.serviceModel>标记之后添加下面的块来启用跟踪,但是我没有看到任何正在生成的跟踪文件。

<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> 

编辑:忘了提,如果我尝试使用来自本地环境的生产服务,它工作正常!

+1

你为什么在相同的过程中托管服务和消费者?这意味着零。 –

+0

@hugh - 好的,原因如下 - 我有多个同一个Web应用程序的实例,它们服务于不同的组织。有问题的服务公开它运行的实例的某些数据(这些数据可能因实例而异)。每个实例都知道在其他实例中运行的其他服务(服务的URL存储在数据库中)。 Web应用程序中有一个特定的模块,它基本上从它知道的所有服务中提取数据并显示它。所以基本上目的是显示相关组织的数据。 – 1nfected

+0

因此,您的每个服务都在不同的w3wp.exe实例中运行?每个Web应用程序的客户端也只调用在不同的w3wp进程中运行的服务? –

回答

2

那么,原来是一个完全不同的问题。 原来,Web应用程序(实际上是服务)不能从服务器本身访问,也就是说,如果我尝试从服务器本身浏览网站,我会收到“Page not found”消息。

0

我也有同样的问题。在我的情况下,我正在拨打电话的服务器有防火墙问题。他们没有打开防火墙。他们打开后,问题就解决了。

相关问题