【问题标题】:WCF service working in iis 5.1 but not working in iis 6WCF 服务在 iis 5.1 中工作,但在 iis 6 中不工作
【发布时间】:2011-01-13 15:13:24
【问题描述】:

我开发了一个 WCF 服务和 silverlight 客户端,当我在具有 iis 5.1 的 windows xp 中托管此服务时,它可以按预期完美运行。

当我在具有 iis 6 的 Windows Server 2003 R2 中托管时,它会在最初的几分钟(大约 20 分钟)内工作,然后停止工作。

我在访问服务时收到 HTTP 500。

我使用的设置是

匿名访问和集成身份验证都被检查。

我的服务配置如下

<system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="false"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <customBinding>
    <binding name="SilverlightApplication1.Web.GetData.customBinding0">
      <binaryMessageEncoding/>
      <httpTransport/>
    </binding>
  </customBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<services>
  <service name="SilverlightApplication1.Web.GetData">
    <endpoint address="" binding="customBinding" bindingConfiguration="SilverlightApplication1.Web.GetData.customBinding0" contract="SilverlightApplication1.Web.GetData"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>

我的 silverlight 客户端配置是

<client>
        <endpoint address="----/InternalBorrow/GetData.svc"
            binding="customBinding" bindingConfiguration="CustomBinding_GetData"
            contract="ServiceReference1.GetData" name="CustomBinding_GetData" />
    </client>

任何机构可以帮助我解决我的问题吗?

我得到的例外是

 System.ServiceModel.Activation.HostedAspNetEnvironment.ValidateHttpSettings(String virtualPath, Boolean isMetadataListener, Boolean usingDefaultSpnList, AuthenticationSchemes& supportedSchemes, ExtendedProtectionPolicy& extendedProtectionPolicy, String& realm)at System.ServiceModel.Channels.HttpChannelListener.ApplyHostedContext(String virtualPath, Boolean isMetadataListener)

at System.ServiceModel.Activation.HostedAspNetEnvironment.ApplyHostedContext(TransportChannelListener listener, BindingContext context)

at System.ServiceModel.Channels.HttpTransportBindingElement.BuildChannelListener[TChannel](BindingContext context)

at System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener[TChannel]()

at System.ServiceModel.Channels.MessageEncodingBindingElement.InternalBuildChannelListener[TChannel](BindingContext context)

at System.ServiceModel.Channels.BinaryMessageEncodingBindingElement.BuildChannelListener[TChannel](BindingContext context)

at System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener[TChannel]()

at System.ServiceModel.Channels.Binding.BuildChannelListener[TChannel](Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, BindingParameterCollection parameters)

at System.ServiceModel.Description.DispatcherBuilder.MaybeCreateListener(Boolean actuallyCreate, Type[] supportedChannels, Binding binding, BindingParameterCollection parameters, Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, ServiceThrottle throttle, IChannelListener& result, Boolean supportContextSession)

at System.ServiceModel.Description.DispatcherBuilder.BuildChannelListener(StuffPerListenUriInfo stuff, ServiceHostBase serviceHost, Uri listenUri, ListenUriMode listenUriMode, Boolean supportContextSession, IChannelListener& result)

at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)

at System.ServiceModel.ServiceHostBase.InitializeRuntime()

at System.ServiceModel.ServiceHostBase.OnBeginOpen()

at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)

at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

at System.ServiceModel.Channels.CommunicationObject.Open()

at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)

at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)

--- End of inner exception stack trace ---

at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)

【问题讨论】:

标签: wcf iis-5


【解决方案1】:

当我们在与配置为使用较低版本的 .NET 的 Web 服务相同的应用程序池中运行 .NET 4.0 Web 应用程序时,我遇到了类似的问题。确保您没有在服务器上的同一应用程序池中混合 ASP .NET 版本。

网络服务器的事件查看器日志中是否显示任何错误或警告,可以为您提供有关该问题的更多信息?

【讨论】:

  • 你能告诉我 Web 服务器的事件查看器日志在哪里吗?
  • 它应该在“开始”>“控制面板”>“管理工具”>“计算机管理”下
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-07-12
  • 2011-12-26
  • 2010-12-01
  • 1970-01-01
  • 2020-04-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多