[英]Visual Studio is not generating PollingDuplex Proxy Client
Visual Studio沒有為我的PollingDuplex代理創建構造函數。 WCF客戶端應該有8個構造函數,並且構造函數包括HttpPollingDuplexBinding對象和一個端點地址。 但是只有5個重載,並且客戶端沒有Callback方法。 我該如何解決這個問題?
var address = new EndpointAddress("http://"
+ App.Current.Host.Source.DnsSafeHost
+ ":"
+ App.Current.Host.Source.Port.ToString(CultureInfo.InvariantCulture)
+ "/PService.svc");
return new ServiceClient(binding, address);
這是這里提到的已知問題
http://blogs.msdn.com/b/silverlightws/archive/2010/04/04/some-known-wcf-issues-in-silverlight-4.aspx
但是仍然不能產生所有的構造函數。 盡管我相信這可能是面對此問題的人的答案。
編輯:
很奇怪。
[ServiceContract]
public interface IMyCallback
{
[OperationContract(IsOneWay = true, AsyncPattern = true)]
IAsyncResult BeginNotify(Message message, AsyncCallback callback, object state);
void EndNotify(IAsyncResult result);
[OperationContract(IsOneWay = true)]
void OnX();
}
工作正常。 但是這個
[ServiceContract]
public interface IPokerClient
{
[OperationContract(IsOneWay = true)]
void OnX();
[OperationContract(IsOneWay = true, AsyncPattern = true)]
IAsyncResult BeginNotify(Message message, AsyncCallback callback, object state);
void EndNotify(IAsyncResult result);
}
在這里工作不正常。 我不知道,但是我什么也沒有改變,只是得到了帶有回調函數的代理。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.