I have a WCF service that uses MSMQ communication, when i run the service on my local netwrok, i configure the service endpoints in the client config files to point to the host computer, for example if the endpoint specified on the service host is:
<endpoint address="net.msmq://localhost/private/MsmqService/MyMsmqService"
binding="netMsmqBinding" bindingConfiguration="test" contract="MsmqService.IMyMsmqService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
I configure my client to send messages to this endpoint:
<endpoint address="net.msmq://192.168.1.5/private/MsmqService/MyMsmqService"
binding="netMsmqBinding" bindingConfiguration="test" contract="MsmqService.IMyMsmqService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
Obviously 192.168.1.5 is the IP of the host computer, this works like a charm. I host my service in IIS 7, I activate the MSMQ listener on IIS, give appropriate access right etc (Pretty much everything in Tom Hollanders article) and I can even access my service over http in my browser, but when I create clients of my service which is hosted in IIS and configure the endpoints in the client App.config
, naturally I configure my clients to this:
<endpoint address="net.msmq://ServiceHostPublicIP/private/MsmqService/MyMsmqService"
binding="netMsmqBinding" bindingConfiguration="test" contract="MsmqService.IMyMsmqService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
That's where things go wrong. The messages I send keep getting queued in an outgoing queue on the client machine: DIRECT=OS:[ServiceHostPublicIP]\private$\MsmqService\MyMsmqService
and the state of the queue is always: 'Waiting to Connect'. I've tried setting the queue transfer protocol to SRMP
, my queue name is the same as my service name as is required by IIS, and I've given appropriate permissions on the queue. Has anybody recently encountered this problem before? Any Ideas? It'd be great if somebody could share a working sample of MSMQ over HTTP if they had one.
Any help would be greatly appreciated. Thanks in advance.