예제 #1
0
            public void BeginTask()
            {
                switch (requestMessage.Operation)
                {
                case CommandMessage.OperationCode.ClientPing:
                    responseMessage = AcknowledgeMessage.CreateAcknowledgeResponse(requestMessage, null);
                    SignalCompletion(true);
                    break;

                default:
                    responseMessage = ErrorMessage.CreateErrorResponse(requestMessage,
                                                                       String.Format(CultureInfo.CurrentCulture,
                                                                                     "Operation '{0}' is not supported by the default command service.", requestMessage.Operation),
                                                                       "Gateway.DefaultCommandService.UnsupportedOperation", null);
                    SignalCompletion(true);
                    break;
                }
            }
예제 #2
0
            public void BeginTask()
            {
                CommandMessage commandMessage = requestMessage as CommandMessage;

                if (commandMessage != null)
                {
                    responseMessage = ErrorMessage.CreateErrorResponse(requestMessage,
                                                                       "Remoting service does not handle command messages currently.",
                                                                       "Gateway.RemotingService.UnsupportedCommandMessage", null);
                    SignalCompletion(true);
                    return;
                }

                RemotingMessage remotingMessage = (RemotingMessage)requestMessage;

                responseMessage = AcknowledgeMessage.CreateAcknowledgeResponse(remotingMessage, new object[] { "Response!" });
                SignalCompletion(true);
            }