Exemple #1
0
        public void SubmitMessage(MultipartMessageDefinition MultipartMessage)
        {
            Debug.WriteLine(String.Format("Mock Service : {0}", OperationContext.Current.Channel.LocalAddress.Uri.AbsoluteUri));
            Debug.WriteLine(String.Format("Received message : {0}", String.IsNullOrEmpty(MultipartMessage.Description)?"<No description provided>":MultipartMessage.Description));
            Debug.WriteLine(String.Format("Nb Parts : {0}", MultipartMessage.Parts.Length));

            this.LocalReceivedMessages.Add(MultipartMessage);
            MockServiceEventHub.RaiseMessageReceived(OperationContext.Current.Channel.LocalAddress.Uri.AbsoluteUri, MultipartMessage);
        }
        public void SubmitMessage(ref MultipartMessageDefinition MultipartMessage)
        {
            Debug.WriteLine(String.Format("Mock Service : {0}", OperationContext.Current.Channel.LocalAddress.Uri.AbsoluteUri));
            Debug.WriteLine(String.Format("Received message : {0}", String.IsNullOrEmpty(MultipartMessage.Description)?"<No description provided>":MultipartMessage.Description));
            Debug.WriteLine(String.Format("Nb Parts : {0}", MultipartMessage.Parts.Length));

            this.LocalReceivedMessages.Add(MultipartMessage);
            MockServiceEventHub.RaiseMessageReceived(OperationContext.Current.Channel.LocalAddress.Uri.AbsoluteUri, MultipartMessage);

            foreach (Settings.MessageResolutionSetting setting in this.LocalResolutionSettings)
            {
                if (setting.Probe(MultipartMessage))
                {
                    MockServiceEventHub.RaiseMessageResolved(OperationContext.Current.Channel.LocalAddress.Uri.AbsoluteUri, setting.TargetMessage);
                    MultipartMessage = setting.TargetMessage;
                    return;
                }
            }

            throw new FaultException("Unable to resolve message");
        }