WCF in IIS, using MSMQ in workgroup mode

后端 未结 4 1415
悲哀的现实
悲哀的现实 2021-02-07 21:32

I\'ve been trying out MSMQ with WCF, but I can\'t seem to get it to work properly. I\'ve got the client (which sends messages to the queue) working, by using WCF and a service r

相关标签:
4条回答
  • 2021-02-07 21:58

    When we faced the issue <security mode="None"> worked in the test environment.

    During final delivery , even that didn't work.. Finally this one worked

    <security>
    <transport
    msmqAuthenticationMode="None"
    msmqProtectionLevel="None"/>
    </security>
    
    0 讨论(0)
  • 2021-02-07 22:02

    Not sure if this is going to solve your concrete problem here, but there's a really good three-part blog post series by Tom Hollander:

    • MSMQ, WCF and IIS: Getting them to play nice (part 1 of 3)
    • MSMQ, WCF and IIS: Getting them to play nice (part 2 of 3)
    • MSMQ, WCF and IIS: Getting them to play nice (part 3 of 3)

    Also, since the Active Directory stuff seems to be the problem, have you tried to tell your MSMQ binding to not use AD ??

    <bindings>
      <netMsmqBinding>
         <binding name="MsmqBindingNonTransactionalNoSecurity" 
                  deadLetterQueue="Custom" exactlyOnce="false"
                  useActiveDirectory="false">   <== try this setting here!
            <security mode="None" />
         </binding>
      </netMsmqBinding>
    </bindings>
    
    0 讨论(0)
  • 2021-02-07 22:13

    Dennis van der Stelt provide a good sample on WCF + MSMQ.

    You may also be interested in this Q/A on MSDN:

    Q: When I run the sample that uses a default binding in workgroup mode, messages seem to get sent but are never received by the receiver.

    A: By default, messages are signed using an MSMQ internal certificate that requires the Active Directory directory service. In workgroup mode, because Active Directory is not available, signing the message fails. So the message lands in the dead-letter queue and failure cause, such as “Bad signature”, is indicated.

    The workaround is to turn off security. This is done by setting Mode = None to make it work in workgroup mode.

    Another workaround is to get the MsmqTransportSecurity from the Transport property and set it to Certificate, and set the client certificate.

    Yet another workaround is to install MSMQ with Active Directory integration.

    0 讨论(0)
  • 2021-02-07 22:18

    Try these settings... useActiveDirectory should be false by default, but try it. The authentication mode is set on the transport itself, so msmqAuthenticationMode should be set to 'none'. msmqProtectionLevel and clientCredentialType sound relevant, so I threw them in there, too
    : )


    <bindings>
      <netMsmqBinding>
         <binding name="MsmqBindingNonTransactionalNoSecurity" 
              deadLetterQueue="Custom"
              useActiveDirectory="false" 
              exactlyOnce="false">
           <security mode="None">
             <transport 
                msmqAuthenticationMode="None"
                msmqProtectionLevel="None"
                clientCredentialType="None"/>
           </security>
         </binding>
      </netMsmqBinding>
    </bindings>
    

    I'd be concerned about removing all the security, however... if you're on a domain, you should install MSMQ with Active Directory Integration, or use Workgroup methods of securing the messages.

    Also, don't forget, the settings for the server and client have to match.

    HTH,
    James

    Sorry for the continual updates, my attention to details seems to be a bit low today
    : P

    0 讨论(0)
提交回复
热议问题