Windows Vista Beta | WinVistaBeta.com - Message | Create a proxy if i dynamically get a Type of contract.

January 05, 2009  
Subject: Create a proxy if i dynamically get a Type of contract.
Group: microsoft.public.windows.developer.winfx.indigo
Date: 12/18/2007 11:17:55 AM
From: janko.klemensek@gmail.com

I want to dynamically create a proxy. I have an assembly and a string
(e.g. "IService") of contract (interface) in this assembly.
I can get a variable of type Type of interface which is a contract for
a service.
Beacuse i get this at run-time, i can't use generic ChannelFactory
like this:

IServiceBase mProxy =
ChannelFactory<IService>.CreateChannel(lNetTcpBinding,
lEndpointAddress);

(IService inherit from IserviceBase)


My question is how can I dynamically create mProxy for that service?

Thanks.

Back