Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem Getting WCF MSMQ Sample To Work

107 views
Skip to first unread message

MichaelPyles

unread,
Feb 2, 2010, 1:09:01 PM2/2/10
to
I'm unable to get the WCF sample that uses net.msmq bindings to work. This
is the path to the sample in the WCF samples download from the link on this
page:http://msdn.microsoft.com/en-us/library/ms751493.aspx. The sample is
\Samples\WCFWFCardSpace\WCF\Basic\Binding\Net\Msmq\Transacted\CS. It uses
transactions.

I changed the sample to remove all http communication. Everything works
fine so long as both client and server run on the same server. When the
client and server are running on different servers, it doesn't work. Without
transactions enabled, it does work.

The queue is on the client's server. The message does get written to that
queue, so that much works. However I get no notification the service (host)
has read the message. I'm sure it does not because the message remains in
the queue. I'm using a public queue with full control granted to these
accounts: my domain account, network service, system, everyone. When I
close the service console app (by hitting the enter key - it's waiting on a
console read to exit), I get the following exception:

Unhandled Exception:
System.ServiceModel.CommunicationObjectFaultedException: The communication
object, System.ServiceModel.ServiceHost, cannot be used for communication
because it is in the Faulted state.
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
at System.ServiceModel.ServiceHostBase.System.IDisposable.Dispose()
at Microsoft.ServiceModel.Samples.OrderProcessorService.Main()

I ran into this problem with my own WCF application and decided to try the
sample app as a last resort. I'm suspecting something needs to be configured
with the DTC since the problem exists only when using transactions.

Any ideas? If there's a better newsgroups to post in, please let me know.
thanks.

MichaelPyles

unread,
Feb 2, 2010, 1:15:01 PM2/2/10
to
Forgot to mention I'm using 2008 server R2, which is MSMQ 6.1. Seems like
this issue may be related to a problem another poster had doing remote reads
with transactions. He was using MSMQ 4.0.

MichaelPyles

unread,
Feb 2, 2010, 7:46:02 PM2/2/10
to
I got this one to work using the instructions for setting up the DTC (for
2008 server need to directly modify the registry). As I understand it, .NET
4.0 will support "non-destructive" reads and no "pre-fetch" when reading from
an MSMQ under WCF. That way transactions shouldn't be required in most
cases. The WCF configuration properties will expose whether or not a queue
uses destructive or non-destructive reads when receiving data from it.

I'm seeing horrible performance using DTC.

John Breakwell

unread,
Feb 15, 2010, 6:34:01 AM2/15/10
to
Hi

Sorry for not replying to your 4 posts - for some reason they haven't shown
up in my newsreader and I only noticed them when I browsed on
http://www.microsoft.com/communities.

Are you still having the MSMQ/WCF problem?

Cheers
John Breakwell (MSFT)
--
http://blogs.msdn.com/johnbreakwell


San

unread,
Jun 21, 2010, 4:11:27 AM6/21/10
to
I ran into similar problem just changed my configuration URL Address End
points. This worked for me.
0 new messages