Example #1
0
        public Response ExecuteProxyOperationB(Request value)
        {
            ExecuteRules(value, "ExecuteProxyOperationB");
            StrategyBRequest request = RequestTranslator.Translate<Request, StrategyBRequest>(value);

            var response = (StrategyBResponse)OperationACommunicator.InvokeOperation(new List<object> {
                    request
            }.ToArray());

            return ResponseTranslator.Translate<StrategyBResponse, Response>(response);
        }
Example #2
0
        private void ExecuteRules(Request value, string operationName)
        {
            List<string> ruleResult = RequestRules.Execute(value).ToList();
            if (ruleResult.Count == 0) return;

            List<string> operation = new List<string>();
            List<string> problemType = new List<string>();

            foreach (string violation in ruleResult)
            {
                operation.Add(operationName + "-ExecuteRules");
                problemType.Add(violation);
            }

            throw new FaultException<RulesFault>(new RulesFault
            {
                Operation = operation.ToArray(),
                ProblemType = problemType.ToArray()
            });
        }