0

I have my service on a web site. I try to run this example, first just the server part: :What steps do I need to take to use WCF Callbacks?

But I get this message: "Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it."

The Web.config file, doesn't have definitions such 'BasicHttpBinding'. It only has more general defitions. Do i have to add lines to it, or there is a more simple way. Many thanks.

Community
  • 1
  • 1
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders May 30 '15 at 19:54
  • 1
    `BasicHttpBinding` is the default binding for `http` services in WCF - if you don't specify something else in the code or the config, you will get `BasicHttpBinding` for any client connecting to your service over `http`. Note that in the example you linked to is using `NetTCP`, which *does* support duplex. I suggest trying the whole example first, to see if you can get it to run, rather than piecemeal. – Tim May 30 '15 at 19:58
  • but the server depends on the client? and what if server is started first? – user3344394 May 30 '15 at 20:00
  • @user3344394 - Have you tried running the complete, posted example? The service has to be running for the client to connect. The service does not depend on the client, outside of needing a client to make the callback to. – Tim May 30 '15 at 20:03
  • it's not so clear in the example what methods belong to the client. MyContractClient and MyCallbackClient and Program should be on the client side? – user3344394 May 30 '15 at 20:09
  • In the example, `MyContractClient` is used by the client to invoke operations which the service will execute. `MyCallbackClient` is implemented on the client to handle callbacks from the service. To further clear things up, the `IMyContract` lists the methods the client may invoke and `IMyContractCallback` lists the methods the service may invoke. – Derek W May 30 '15 at 23:31
  • it's not possible to attach the service reference to the client: I get this error: contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it. – user3344394 May 31 '15 at 08:13
  • 1
    @user3344394 - `BasicHttpBinding` does not support duplex. To do this over HTTP, you would use `DualWsHttpBinding`. Have you done as I suggested yesterday and tried to build and run the *entire* example? It looks like your somewhat new to WCF and you're attempting to pick and choose parts of code without understanding the whole. While you can do that and learn, it'll be a long and frustrating path, especially in WCF. – Tim May 31 '15 at 23:55

0 Answers0