WCF service never notified when post new message to private queue in Workgroup mode

msmqwcf

I'm using WCF (C#) to send/receive messages from a private MSMQ queue under Windows Server 2003 in Workgroup mode.

Client WCF/Service WCF and MSMQ are on the same computer.

There's one client that send message to the private queue, that works perfectly. There's one service that receives message from the same private queue, but the service seems to be never be called by MSMQ. (no errors occur)

Messages stack up on the queue but nothing pull out. On another computer (domain mode and not workgroup mode) messages was sent and received perfectly.

What's wrong with the workgroup mode that cause MSMQ to never call my service ?

After, I write a C# test, always on same computer, but this time i created MessageQueue and subscribe to the ReceiveCompleted event this way:

MessageQueue MQueue = new MessageQueue(".\\private$\\nameofmyqueue");
MQueue.MessageReadPropertyFilter.SetAll();
MQueue.ReceiveCompleted += MessageEventHandler;
Message Msg = MQueue.Receive();

And I receive events from MSMQ queue when there's new message now.

I think there's trouble in my service configuration (WFC config) or in my namespace reservation.

Best Answer

I found where was my trouble. In fact I used a transacted service that call SQL server 2005 procedure.

In order to use transacted binding with SQL 2005, execution of procedure is braced in a transaction scope.

If an exception was thrown and not caught, DTC used to rollback process.My trouble is that DTC/remote client connection was not activated on my server.

So, either you should activate DTC/remote client connection either you don't use transaction scope.

If you want to use DTC and remote client connection, remote client connection must be activated before because activate DTC and remote client connection cause reboot of the server.

Related Topic