My solution is a mix off some answers here.
My queue has authentication enable, so some steps may not be needed if authentication is not used.
Here is the steps i follow to put it to work, on a windows 2012:
1) Install non-http activation services WAP (https://msdn.microsoft.com/en-us/library/ms731053(v=vs.110).aspx)
2) Create queue with the same name as the IIS application, like this private$/<WCF application>/myservice.svc
.
The Net.Msmq Listener Adapter
service will try to match the queue and the WCF application name in IIS as pointed by VdesmedT.
3) Enable protocols on site and application.
First create the binding:
%windir%\system32\inetsrv\appcmd.exe set site "Default Web Site"
-+bindings.[protocol='net.tcp',bindingInformation='808:*']
Site bindings should look like this:
Then enable the protocol net.msmq
for the site
%windir%\system32\inetsrv\appcmd.exe set config
-section:system.applicationHost/sites "/[name='Default Web Site'].[path='/'].enabledProtocols":"http,net.msmq" /commit:apphost
This command will rewrite protocols, so if you have more than http enable, you need to add it to the command line.
At Advanced Settins you should see this:
And finally enable the protocol net.msmq
for the application.
%windir%\system32\inetsrv\appcmd.exe set app "Default Web Site/" /enabledProtocols:http,net.tcp
The Advanced Settings screen for the application should show the same thing that appears on Advanced Settings for the site, at the enabled protocols line.
4) Give permissions on queue for IIS application to Read, peek and delete, get properties and set properties.
The default account is IIS Apppool\DefaulApp
5) Give peek permission on queue for services Net.Msmq Listener Adapter
(default is Network Service
)
Shouldn't need but i had to restart after changing permissions.
Checks:
To check if WCF is setup properly just use the browse the WCF
application to activate it. Any messages in queue should be processed.
To check if WAS is activating the WCF application, recycle the Application pool and send a new message. If WAS
works it should be process immediately.