Ejemplo n.º 1
0
        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);
        }
        private IMethodReturnMessage InvokeEndService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
        {
            IAsyncResult result;

            object[] objArray;
            operation.MapAsyncEndInputs(methodCall, out result, out objArray);
            object ret = this.serviceChannel.EndCall(operation.Action, objArray, result);

            object[] returnArgs = operation.MapAsyncOutputs(methodCall, objArray, ref ret);
            return(this.CreateReturnMessage(ret, returnArgs, methodCall));
        }
            protected object EndInvoke(string methodName, object[] args, IAsyncResult result)
            {
                object[] objArray2;
                object[] destinationArray = new object[args.Length + 1];
                Array.Copy(args, destinationArray, args.Length);
                destinationArray[destinationArray.Length - 1] = result;
                IMethodCallMessage    methodCall      = new MethodCallMessage <TChannel, T>(destinationArray);
                ProxyOperationRuntime operationByName = this.GetOperationByName(methodName);

                operationByName.MapAsyncEndInputs(methodCall, out result, out objArray2);
                object ret = this.channel.EndCall(operationByName.Action, objArray2, result);

                object[] sourceArray = operationByName.MapAsyncOutputs(methodCall, objArray2, ref ret);
                if (sourceArray != null)
                {
                    Array.Copy(sourceArray, args, args.Length);
                }
                return(ret);
            }
Ejemplo n.º 4
0
            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);
            }