Jochen Kühner
Jochen Kühner

Reputation: 1411

WCF DuplexChannel - Connection Without Callback

I have a WCF Interface which has defined a Callback. This is working very well.

Now I have another Client which don't need the callback. I wanted to know if there is a way to connect to the service also without specifying a callback object?

I tried without the DuplexChannel factory, or DuplexChannelFactory with InstanceContext (null), both it didn't work!

Is there a way to do it?

Upvotes: 0

Views: 564

Answers (2)

Jochen Kühner
Jochen Kühner

Reputation: 1411

I now tryed with this the class from here: http://www.codeproject.com/Articles/22832/Automatic-Interface-Implementer-An-Example-of-Runt worked very well!

Upvotes: 0

PatFromCanada
PatFromCanada

Reputation: 2788

The best way would be to create another interface without the CallbackContract and expose that on a separate Endpoint. That would give you a clean separation between the two code paths and the client could choose which one to use.

Upvotes: 0

Related Questions