0
這裏是我的雙工WCF服務生成的代理:我應該傳遞給雙工WCF客戶實例上下文
public partial class MyWcfServiceClient : System.ServiceModel.DuplexClientBase<Ifa.WcfClients.ServiceReference1.IMyWcfService>, Ifa.WcfClients.ServiceReference1.IMyWcfService {
public MyWcfServiceClient(System.ServiceModel.InstanceContext callbackInstance) :
base(callbackInstance) {
}
.
.
.
}
我想從這個類繼承,並建立一個新的類是這樣的:
public class WcfClientBase : MyWcfServiceClient
{
public WcfClientBase() : base(???)
{
}
somemethod1(){....}
somemethod2(){....}
}
我的問題是基類需要參數InstanceContext
。我應該通過什麼作爲這個論點?
是的。所以如果服務器調用客戶端方法,我的WcfClientBase中聲明的方法是否被調用?或在回調類中聲明的方法? –
它們將是您傳遞給InstanceContext的對象中的方法,該對象將是回調類。 – Vivek
accodring到此,我不能創建一個子類形式雙工wcf客戶端 –