Visual Studio가 PollingDuplex 프록시 클라이언트를 생성하지 않습니다
-
12-12-2019 - |
문제
Visual Studio가 내 PollingDuPlex 프록시 생성자를 생성하지 않습니다.HttpPollingDuPlexBinding 객체와 엔드 포인트 주소를 포함한 생성자가있는 WCF 클라이언트에 대한 8 개의 생성자가 있어야합니다.그러나 단 5 개의 과부하 만 있고 클라이언트에는 콜백 메소드가 없습니다. 이 문제를 어떻게 수정할 수 있습니까?
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);
. 해결책
여기에 언급 된 것과 같이 알려진 문제점
그러나 여전히 모든 생성자를 생성 할 수는 없습니다.나는 이것이이 문제에 직면 한 사람을위한 대답이 될 수 있다고 믿는 것 같지만
편집 :
매우 이상합니다.
[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);
}
.
는 여기에서 잘 작동하지 않습니다.나는 전혀 모르지만 나는이 일을 바꾸고 콜백 함수를 가진 프록시를 얻는 것입니다.
제휴하지 않습니다 StackOverflow