Jun 6, 2007

Passing callback service implementation to create channel (factory)

I don't like "Add Service Reference", preferring ChannelFactory. The following sample shows how to pass a WCF callback service implementation to DuplexChannelFactory to create a service proxy:

// create the callback endpoint object (client-side service endpoint)

IDeviceServerCallbackService callback = new DeviceServerCallbackService();

InstanceContext context = new InstanceContext(callback);


// create duplex channel

cf = new DuplexChannelFactory<IDeviceServerService>(context, "MasterEndpointDualHttp");

proxy = cf.CreateChannel();

No comments:

Post a Comment