-2

I have a wcf service hosted in a wpf application. I also have a multiple remote clients which are communicating with the service without any problems.

I want to know how to get hold of the service instance from WPF application.

I'm trying to use the IClientCallback returned from OperationContext.Current.GetCallbackChannel<IClientCallback>() to make a call to the operations on the client side when a button is pressed in the WPF application.

The InstanceContextMode = InstanceContextMode.Single on the service side if this helps. Please show me through a code example as I'm new to WCF.

1 Answer 1

0

I figured it out by myself. I had to use the one of the overloaded constructors of servicehost and pass in the class holding the data contracts.

public ServiceHost(
object singletonInstance,
params Uri[] baseAddresses

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.