简体   繁体   English

具有“消息”安全性的WCF Msmq,无法从队列接收消息

[英]WCF Msmq with “Message” security, can't receive messages from the queue

I have a WCF router sending messages to a private msmq using netMsmqBinding. 我有一个WCF路由器,使用netMsmqBinding将消息发送到私有msmq。 I have another WCF service listening for messages on that queue. 我还有另一个WCF服务,用于侦听该队列上的消息。 When the security mode is set to "None" i am able to send messages to the queue and also receive messages from the queue without any issues. 当安全模式设置为“无”时,我可以将消息发送到队列,也可以从队列接收消息,而不会出现任何问题。 When i try and use the "Message" security mode, i am able to send messages to the queue, but i can not receive the messages from the queue, my receive service does not get called. 当我尝试使用“消息”安全模式时,我能够将消息发送到队列,但是我无法从队列中接收消息,因此不会调用我的接收服务。 Any ideas what would be causing this issue? 有什么想法会导致此问题吗? Here is my config file for the service listening for messages... 这是我的服务监听消息的配置文件...

<configuration>
   <system.serviceModel>
      <services>
         <service name="MyService" behaviorConfiguration="ServiceBehavior">
            <host>
               <baseAddresses>
                  <add baseAddress="http://localhost:8000/MyService" />
               </baseAddresses>
            </host>
            <endpoint name="NET.MSMQ_1" 
                      address="net.msmq://localhost/private/TestQueue1" 
                      binding="netMsmqBinding" bindingConfiguration="Binding" 
                      contract="MyContract" />
         </service>
      </services>
      <behaviors>
         <serviceBehaviors>
            <behavior name="ServiceBehavior">
                <serviceMetadata httpGetEnabled="True" />
            </behavior>
         </serviceBehaviors>
      </behaviors>
      <bindings>
         <netMsmqBinding>
             <binding name="Binding">
                 <security mode="Message"/>
             </binding>
         </netMsmqBinding>
      </bindings>
   </system.serviceModel>
</configuration>

Getting MSMQ and WCF to work properly isn't always easy - but it does work! 使MSMQ和WCF正常工作并不总是容易的-但确实可以! :-) :-)

Check out this three-part blog post series by Tom Hollander on the topic - I got my stuff up and running thanks to this: 看看汤姆·霍兰德(Tom Hollander)撰写的有关博客的系列文章,内容由三部分组成-借助以下内容,我的工作得以顺利开展:

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

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