【发布时间】:2012-10-15 13:50:06
【问题描述】:
我有一个异步 WCF 服务,它使用客户端代理调用第二个 SOAP WCF 服务。我无法控制 SOAP Java 服务,但我可以将服务引用上的配置设置为异步运行。
我如何从第二个异步服务获得结果,将值传递回第一个异步服务到客户端??
public class AddService : IAddService
{
// SOAP Java service reference
ResultServiceClient proxy = new ResultServiceClient();
public int AddNumbers(int x, int y)
{
// Am i on the right track here to use BeginXXX, EndXXX?
proxy.BeginGetResult(x, y, new AsyncCallback(OnEndAdd), null);
/// how to return a result here.??????
return result;
}
void OnEndAdd(IAsyncResult result)
{
int result = proxy.EndGetResult(result);
}
}
【问题讨论】:
标签: wcf asynchronous