Ejemplo n.º 1
0
        private async Task doExcuteService(ClientRegistData service, Channel channel, ServiceRequest request, Delegate action)
        {
            var handler    = new ServiceHandlerHelper(service);
            var rpcChannel = channel;

            if (rpcChannel == null)
            {
                rpcChannel = service.ServerChannel;
            }
            var client = new RpcServiceGreeter_Client.RpcServiceGreeterClient(rpcChannel);

            request = new RequestHelper().GetServiceRequest(service, request);
            request = handler.ClientRequest(request);
            await doExcuteService(request, action, client);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 远程服务调用
        /// </summary>
        /// <param name="channel"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        private ServiceResponse doExcuteService(ClientRegistData service, Channel channel, ServiceRequest request)
        {
            var handler    = new ServiceHandlerHelper(service);
            var rpcChannel = channel;

            if (rpcChannel == null)
            {
                rpcChannel = service.ServerChannel;
            }
            var client = new RpcServiceGreeter_Client.RpcServiceGreeterClient(rpcChannel);

            request = new RequestHelper().GetServiceRequest(service, request);
            request = handler.ClientRequest(request);
            var result = excuteService(service, request, client);

            result = handler.ClientRespons(request, result);
            return(result);
        }