Inheritance: IMethodCallMessage
Exemplo n.º 1
0
		private static void InvokeRealProxy(RealProxy realProxy, WcfInvocation wcfInvocation)
		{
			var message = new MethodCallMessage(wcfInvocation.Method, wcfInvocation.Arguments);
			var returnMessage = (IMethodReturnMessage)realProxy.Invoke(message);
			if (returnMessage.Exception != null)
			{
				throw returnMessage.Exception;
			}
			wcfInvocation.ReturnValue = returnMessage.ReturnValue;
		}
		private static void InvokeRealProxy(RealProxy realProxy, WcfInvocation wcfInvocation)
		{
			var message = new MethodCallMessage(wcfInvocation.Method, wcfInvocation.Arguments);
			var returnMessage = (IMethodReturnMessage)realProxy.Invoke(message);
			if (returnMessage.Exception != null)
			{
				var exception = ExceptionHelper.PreserveStackTrace(returnMessage.Exception);
				throw exception;
			}
			wcfInvocation.ReturnValue = returnMessage.ReturnValue;
		}
		protected virtual void PerformInvocation(IInvocation invocation, IWcfChannelHolder channelHolder)
		{
			PerformInvocation(invocation, channelHolder, wcfInvocation =>
			{
				var realProxy = channelHolder.RealProxy;
				var message = new MethodCallMessage(wcfInvocation.Method, wcfInvocation.Arguments);
				var returnMessage = (IMethodReturnMessage)realProxy.Invoke(message);
				if (returnMessage.Exception != null)
				{
					throw returnMessage.Exception;
				}
				wcfInvocation.ReturnValue = returnMessage.ReturnValue;
			});
		}
		protected virtual void PerformInvocation(IInvocation invocation, IWcfChannelHolder channelHolder)
		{
			Action sendAction = () =>
			{
				var proxy = channelHolder.RealProxy;
				var message = new MethodCallMessage(invocation.Method, invocation.Arguments);
				var returnMessage = (IMethodReturnMessage)proxy.Invoke(message);

				if (returnMessage.Exception != null)
				{
					throw returnMessage.Exception;
				}

				invocation.ReturnValue = returnMessage.ReturnValue;
			};

			ApplyActionPolicy(channelHolder, invocation, sendAction);
		}