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

发布于 2024-10-20 03:19:37 字数 1444 浏览 3 评论 0原文

我有一个 WCF 路由器使用 netMsmqBinding 向专用 msmq 发送消息。我有另一个 WCF 服务正在侦听该队列上的消息。当安全模式设置为“无”时,我可以向队列发送消息,也可以从队列接收消息,没有任何问题。当我尝试使用“消息”安全模式时,我能够将消息发送到队列,但无法从队列接收消息,我的接收服务不会被调用。有什么想法会导致这个问题吗?这是我用于侦听消息的服务的配置文件......

<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>

I have a WCF router sending messages to a private msmq using netMsmqBinding. I have another WCF service listening for messages on that queue. 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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

っ〆星空下的拥抱 2024-10-27 03:19:37

让 MSMQ 和 WCF 正常工作并不总是那么容易 - 但它确实有效! :-)

查看 Tom Hollander 围绕该主题撰写的由三部分组成的博客文章系列 - 多亏了这个,我才得以启动并运行我的东西:

Getting MSMQ and WCF to work properly isn't always easy - but it does work! :-)

Check out this three-part blog post series by Tom Hollander on the topic - I got my stuff up and running thanks to this:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文