在 Windows 2008 上的 Windows 服务中托管 WCF(mex 端点)服务 [英] Hosting a WCF(mex endpoint) service inside a windows service on windows 2008

查看:30
本文介绍了在 Windows 2008 上的 Windows 服务中托管 WCF(mex 端点)服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 托管服务中托管 WCF 服务.

I'm hosting a WCF service inside a windows hosted service.

当我启动 WHS 时,出现以下错误:

When I start the WHS, I get the following error:

The ChannelDispatcher at 'net.tcp://mysecreturl/' with contract(s) '"IClass"' is unable to open its IChannelListener.

System.InvalidOperationException: A registration already exists for URI 'net.tcp://mysecreturl/Indexer/'.
   at System.ServiceModel.Channels.UriPrefixTable`1.RegisterUri(Uri uri, HostNameComparisonMode hostNameComparisonMode, TItem item)
   at System.ServiceModel.Channels.ConnectionOrientedTransportManager`1.Register(TransportChannelListener channelListener)
   at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
   at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
   at System.ServiceModel.Channels.ConnectionOrientedTransportChannelListener.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.TcpChannelListener`2.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)

   at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at VBoD.Search.WindowsServiceHost.WindowsServiceHost.OnStart(String[] args) in D:\......:line 29

System.ServiceModel

这些是在 Windows 中的某个地方,还是在我启动/停止进程时注册和取消注册?

Are these somewhere in Windows or are they registered and unregistered when I start/stop the process?

推荐答案

为 Mex 使用不同的端点.它可能也需要与您的 net.tcp 端口不同的端口号.如果你的 net.tcp 端口是 8000 然后试试

Use a diffeent endpoint for Mex. It probably needs a different port number from you net.tcp port as well. If your net.tcp port is 8000 then try

<endpoint address="net.tcp://mysecreturl:8001/Mex" 
          contract="IMetadataExchange" />

这篇关于在 Windows 2008 上的 Windows 服务中托管 WCF(mex 端点)服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆