There is good and very knowledgeable article of working with MSMQ and WCF from Tom Hollander's blog. Here is the link to start with. He had explain about creating and configuring MSMQ on IIS.
This is my first attempt to start with MSMQ, everything goes great but at the time of hitting WCF service from browser [having mex endpoint]; I got Access is denied error!!!.
The actual error look like bellow.
System.ServiceModel.MsmqException: An error occurred while opening the queue:Access is denied. (-1072824283, 0xc00e0025). The message cannot be sent or received from the queue. Ensure that MSMQ is installed and running. Also ensure that the queue is available to open with the required access mode and authorization.
From error one can easily identify that its something related to Access of current user. It's not user who is logged into system, but its user under which MSMQ is hosted, generally its Application Pool account which you have to give permission.
So for that you must know what is the application pool in which your MSMQ is hosted, and what is the login authority its using. Usually application are hosted in DefaultAppPool, you need to check what is the identity of your application pool runs under. To do so you have to open Internet Information Service (IIS); and there in application pool select your application pool and check its Advance Settings. [The following image is IIS 7 in windows 7 64 bit machine]
This identity can be different for different servers. There are four types of in-built account which can be used as identity or Custom account.
In case of Custom account, Local service, local system or network service we can easily identity the user and add access to our Queue. But in case of ApplicationPoolIdentity, you have to give access to Application Pool user, which you can easily get from event viewer. It's generally IIS APPPOOL\[NAME OF POOL]
If you see the log it specified the name of user which is trying to Access Queue but got Access is denied error.
Now you know the name of user, in my case my pool is ASP.NETv4.0 hence my user is IIS APPPOOL\ASP.NET v4.0. Now go to property of your queue and open security tab. One thing to note here is you will not see this user in advance option of select user where people generally find the user and select. You have to write this username into object name text-box.
Make sure that you have wrote correct name by clicking Check Names; if its correct you will get it underlined.
Finally you get user name :) Give full rights to this user and refresh your service.