OperationContext CreateOperationContext(Message incoming) { ServiceRuntimeChannel contextChannel; if (dispatch_runtime.HasCallbackRuntime) { var type = ServiceProxyGenerator.CreateCallbackProxyType(dispatch_runtime.Type, dispatch_runtime.CallbackClientRuntime.CallbackClientType); contextChannel = (ServiceRuntimeChannel)Activator.CreateInstance(type, new object [] { reply_or_input, dispatch_runtime }); } else { contextChannel = new ServiceRuntimeChannel(reply_or_input, dispatch_runtime); } OperationContext opCtx = new OperationContext(contextChannel); opCtx.IncomingMessage = incoming; opCtx.EndpointDispatcher = dispatch_runtime.EndpointDispatcher; return(opCtx); }
OperationContext CreateOperationContext(Message incoming) { IContextChannel contextChannel; if (dispatch_runtime.CallbackClientRuntime.CallbackClientType != null) { #if DISABLE_REAL_PROXY var type = ServiceProxyGenerator.CreateCallbackProxyType(dispatch_runtime, dispatch_runtime.CallbackClientRuntime.CallbackClientType); contextChannel = (ServiceRuntimeChannel)Activator.CreateInstance(type, new object [] { reply_or_input, dispatch_runtime }); #else contextChannel = (IContextChannel) new ClientRealProxy(dispatch_runtime.CallbackClientRuntime.CallbackClientType, new DuplexServiceRuntimeChannel(reply_or_input, dispatch_runtime), true).GetTransparentProxy(); #endif } else { contextChannel = new ServiceRuntimeChannel(reply_or_input, dispatch_runtime); } contextChannel.Open(); // FIXME: timeout? OperationContext opCtx = new OperationContext(contextChannel); opCtx.IncomingMessage = incoming; opCtx.EndpointDispatcher = dispatch_runtime.EndpointDispatcher; return(opCtx); }