private object InvokeEndService(MethodCall methodCall, ProxyOperationRuntime operation) { operation.MapAsyncEndInputs(methodCall, out IAsyncResult result, out object[] outs); object ret = _serviceChannel.EndCall(operation.Action, outs, result); operation.MapAsyncOutputs(methodCall, outs, ref ret); return(ret); }
protected object EndInvoke(string methodName, object[] args, IAsyncResult result) { object[] inArgs = new object[args.Length + 1]; Array.Copy(args, inArgs, args.Length); inArgs[inArgs.Length - 1] = result; MethodCall methodCall = new MethodCall(inArgs); ProxyOperationRuntime op = GetOperationByName(methodName); object[] outs; op.MapAsyncEndInputs(methodCall, out result, out outs); object ret = _channel.EndCall(op.Action, outs, result); object[] retArgs = op.MapAsyncOutputs(methodCall, outs, ref ret); if (retArgs != null) { Fx.Assert(retArgs.Length == inArgs.Length, "retArgs.Length should be equal to inArgs.Length"); Array.Copy(retArgs, args, args.Length); } return(ret); }