简体   繁体   English

WCF - 在新环境中找不到MSMQ端点

[英]WCF - MSMQ endpoint not found in new environment

The setup 设置

I have a WCF service hosted in IIS/AppFabric running on Windows Server 2012R2. 我在Windows Server 2012R2上运行的IIS / AppFabric中托管了WCF服务。 The service is bound to a local transactional MSMQ queue via netMsmqBinding. 该服务通过netMsmqBinding绑定到本地事务MSMQ队列。 My operations are decorated with TransactionScopeRequired = true. 我的操作使用TransactionScopeRequired = true进行修饰。 The service operations recieves calls from a BizTalk server, handles them and send responses back to a remote queue (on the same BizTalk Server), also via a netMsmqBinding. 服务操作接收来自BizTalk服务器的调用,处理它们并将响应发送回远程队列(在同一BizTalk Server上),也通过netMsmqBinding。

 <endpoint name="Outbound" address="net.msmq://int01test.mydomain.com/private/queue.name" binding="netMsmqBinding" bindingConfiguration="QueueBindingConfigurationOutbound" contract="My.Outbound.Contract" /> <netMsmqBinding> <binding name="QueueBindingConfigurationOutbound"> <security> <transport msmqAuthenticationMode="WindowsDomain" msmqProtectionLevel="Sign" /> </security> </binding> </netMsmqBinding> 

In the testing environment this works as intended. 在测试环境中,这可以按预期工作。

Physical setup in testing environment: Server int01test.mydomain.com hosts a BizTalk server and my inbound queue. 测试环境中的物理设置:服务器int01test.mydomain.com托管BizTalk服务器和我的入站队列。 This runs under service account mydomain\\inttestuser. 这在服务帐户mydomain \\ inttestuser下运行。 Server app01test.mydomain.com hosts my application (IIS/AppFabric), my database (SQL server) and my outbound queue. 服务器app01test.mydomain.com托管我的应用程序(IIS / AppFabric),我的数据库(SQL服务器)和我的出站队列。 This runs under service account mydomain\\apptestuser. 这在服务帐户mydomain \\ apptestuser下运行。

The problem 问题

When this solution is promoted to the acceptance testing environment, calls are still handled, but the responses are blocked with error message: 当此解决方案升级到验收测试环境时,仍会处理调用,但响应将被阻止并显示错误消息:

System.ServiceModel.EndpointNotFoundException: An error occurred while opening the queue:Unrecognized error -1072824317 (0xc00e0003). System.ServiceModel.EndpointNotFoundException:打开队列时发生错误:无法识别的错误-1072824317(0xc00e0003)。 The message cannot be sent or received from the queue. 无法从队列中发送或接收消息。 Ensure that MSMQ is installed and running. 确保已安装并运行MSMQ。 Also ensure that the queue is available to open with the required access mode and authorization. 还要确保可以使用所需的访问模式和授权打开队列。 ---> System.ServiceModel.MsmqException: An error occurred while opening the queue:Unrecognized error -1072824317 (0xc00e0003). ---> System.ServiceModel.MsmqException:打开队列时发生错误:无法识别的错误-1072824317(0xc00e0003)。 The message cannot be sent or received from the queue. 无法从队列中发送或接收消息。 Ensure that MSMQ is installed and running. 确保已安装并运行MSMQ。 Also ensure that the queue is available to open with the required access mode and authorization. 还要确保可以使用所需的访问模式和授权打开队列。

Differences 差异

In the testing environment, my service and my database is running on a single server instance. 在测试环境中,我的服务和我的数据库在单个服务器实例上运行。 (The BizTalk Server and it's queue, the target of my outbound messages, is on another server though) In the acceptance testing environment, my solution is deployed on two load balanced servers and the database is on a separate cluster. (BizTalk Server及其队列,我的出站消息的目标,但是在另一台服务器上)在验收测试环境中,我的解决方案部署在两个负载平衡的服务器上,数据库位于一个单独的集群上。 There are also more strict external firewall rules to mimic the production environment. 还有更严格的外部防火墙规则来模仿生产环境。 Even the BizTalk server is clustered, though we communicate machine-to-machine rather than cluster-to-cluster right now. 即使BizTalk服务器是集群的,但我们现在正在进行机器到机器而不是集群到集群的通信。

So setup in QA Environment is: Server int01qa.mydomain.com (clustered with int02qa.mydomain.com) hosts a BizTalk server and my inbound queue. 因此,QA环境中的设置是:服务器int01qa.mydomain.com(与int02qa.mydomain.com集群)托管BizTalk服务器和我的入站队列。 This runs under service account mydomain\\intqauser. 这在服务帐户mydomain \\ intqauser下运行。 Server app01qa.mydomain.com (clustered with app02qa.mydomain.com) hosts my application (IIS/AppFabric) and my outbound queue. 服务器app01qa.mydomain.com(与app02qa.mydomain.com集群)托管我的应用程序(IIS / AppFabric)和我的出站队列。 This runs under service account mydomain\\appqauser. 这在服务帐户mydomain \\ appqauser下运行。 Server db01qa.mydomain.com hosts my database. 服务器db01qa.mydomain.com托管我的数据库。

What we've already tried 我们已经尝试过的

  • We have disabled authentication on the remote queue. 我们已禁用远程队列上的身份验证。
  • We have granted full control to the account which my service is running under as well as to "everyone". 我们已授予对我的服务运行的帐户以及“所有人”的完全控制权。
  • We have, successfully, sent msmq messages manually between the two servers. 我们成功地在两台服务器之间手动发送了msmq消息。
  • I have configured my service to send responses to a local private queue, same error. 我已将我的服务配置为向本地专用队列发送响应,同样的错误。

The problem turned out to be that MSMQ couldn't find a certificate for the app pool user. 问题是MSMQ找不到应用程序池用户的证书。 That is, the 0xc00e0003, MQ_ERROR_QUEUE_NOT_FOUND was really caused by a 0xC00E002F, MQ_ERROR_NO_INTERNAL_USER_CERT Changing security settings to 也就是说,0xc00e0003,MQ_ERROR_QUEUE_NOT_FOUND确实是由0xC00E002F引起的,MQ_ERROR_NO_INTERNAL_USER_CERT将安全设置更改为

<transport msmqAuthenticationMode="None" msmqProtectionLevel="None" />

enabled messages to be sent. 已启用的消息将被发送。 The real solution, of course, is not to disable security but to ensure that the app pool users cerificate is installed in msmq. 当然,真正的解决方案不是禁用安全性,而是确保在msmq中安装应用程序池用户证书。

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

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