我添加wcf服务引用并勾选名为Generate Asynchronous Operation的选项。我发现代理代码是这样添加的....
public interface ICalculator {
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICalculator/Add", ReplyAction="http://tempuri.org/ICalculator/AddResponse")]
double Add(double n1, double n2);
[System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/ICalculator/Add", ReplyAction="http://tempuri.org/ICalculator/AddResponse")]
System.IAsyncResult BeginAdd(double n1, double n2, System.AsyncCallback callback, object asyncState);
double EndAdd(System.IAsyncResult result);
}
现在我想以异步方式调用wcf服务事件驱动方式。所以请任何人帮助我如何以事件驱动的方式异步调用wcf服务。如果可能的话,给我一个小的示例代码或者从我可以获得知识的地方开车到右边的URL。感谢