简体   繁体   English

wcf msmq服务激活失败

[英]wcf msmq service activation fails

I have wcf service using net.msmq protocol but service fails to activate with following error. 我有使用net.msmq协议的wcf服务,但服务无法激活,但有以下错误。 What could be wrong? 可能有什么不对?

Looks like it is trying to find machineid or something in AD but why? 看起来它试图找到AD中的机器人或东西,但为什么? Sevice name is like net.msmq://localhost/private/myservice.svc 服务名称类似于net.msmq://localhost/private/myservice.svc

  A connection with Active Directory cannot be established. Verify that there are sufficient permissions to perform this operation.

System.Messaging.MessageQueue.GetMachineId(String machineName)
System.Messaging.MessageQueueCriteria.set_MachineName(String value)
System.Messaging.MessageQueue.GetPublicQueuesByMachine(String machineName)
System.ServiceModel.Channels.MsmqBindingMonitor.OnTimer(Object state)

What security settings to you have? 你有什么安全设置? By default, the MSMQ binding will expect users to present a certificate to authenticate them and needs access to AD to verify that certificate. 默认情况下,MSMQ绑定将期望用户提供证书以对其进行身份验证,并且需要访问AD以验证该证书。

If you want to totally turn off all security, add this snippet to your config: 如果您想完全关闭所有安全性,请将此代码段添加到您的配置中:

<bindings>
  <netMsmqBinding>
    <binding name="NoSecurity">
      <security mode="off" />
    </binding>    
  </netMsmqBinding>
</bindings>
<endpoint name="...." address="..." contract="....."
   binding="netMsmqBinding" bindingConfiguration="NoSecurity" />

That way, you should be able to call MSMQ without access to AD. 这样,您应该能够在不访问AD的情况下调用MSMQ。

Marc

Maybe it needs to check with AD to be able to write to the message queue. 也许它需要检查AD才能写入消息队列。

If you are running under a local account that does not have access to AD you may get this error. 如果您在无法访问AD的本地帐户下运行,则可能会出现此错误。

I've had this error when my WCF service is hosted by a Windows Service that is running as the LocalSystem or NetworkService account. 当我的WCF服务由作为LocalSystem或NetworkService帐户运行的Windows服务托管时,我遇到此错误。 Changing the Windows Service to run under an interactive login account, like my own account or one I create just to host MSMQ-WCF Windows Services, eliminates this problem. 将Windows服务更改为在交互式登录帐户下运行,例如我自己的帐户或我仅为托管MSMQ-WCF Windows服务创建的帐户,可以消除此问题。

I believe the error is not related to WCF, but rather the service not having an interactive login that can auto-retrieve an AD certificate that will allow the WCF code to communicate with MSMQ. 我相信错误与WCF无关,而是没有交互式登录的服务可以自动检索允许WCF代码与MSMQ通信的AD证书。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM