3

I'm using WCF and netmsmqbinding and I am getting the following error message:

Contract requires TwoWay (either request-reply or duplex), but Binding 'NetMsmqBinding' doesn't support it or isn't configured properly to support it. Why?

My environment is window 2003 server. The wcf servcie is hosting as a window service. Thank you in advance for your help.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Don
  • 31
  • 1
  • 2

2 Answers2

4

Caveats about queued binding in WCF include that all service operations must be one-way because the default queued binding in WCF does not support duplex communication using queues.

To do not have this error you will need to change the OperationContract attribute. Example below:

[OperationContract(IsOneWay = true)]
void YourMethod(YourClass objectHere)

If you need to have two way operation you will need to use a different binding.

Patrick Desjardins
  • 136,852
  • 88
  • 292
  • 341
0

You can only use OneWay operations with a NetMsmqBinding. You need to set the IsOneWay property of the OperationContract attribute to true.

Explanation here:

All service operations must be one-way because the default queued binding in WCF does not support duplex communication using queues. A two-way communication sample (Two-Way Communication) illustrates how to use two one-way contracts to implement duplex communication using queues.

bzlm
  • 9,626
  • 6
  • 65
  • 92
Johann Blais
  • 9,389
  • 6
  • 45
  • 65