public void CanAddComponentToValidStage()
        {
            ReceivePipelineWrapper pipeline  = PipelineFactory.CreateEmptyReceivePipeline();
            IBaseComponent         component = new XmlDasmComp();

            pipeline.AddComponent(component, PipelineStage.Disassemble);
        }
        public IBaseMessage GetNext(IPipelineContext pContext)
        {
            if (messages == null)
            {
                messages = new Queue <IBaseMessage>();
                IBaseMessage msgS1 = null;
                while ((msgS1 = ffDasmPC.GetNext(pContext)) != null)
                {
                    XmlDasmComp xmlDasmPC = new XmlDasmComp();
                    SetXmlDasmProperties(xmlDasmPC);
                    xmlDasmPC.Disassemble(pContext, msgS1);
                    IBaseMessage msgS2 = null;
                    while ((msgS2 = xmlDasmPC.GetNext(pContext)) != null)
                    {
                        messages.Enqueue(msgS2);
                    }
                }
            }

            if (messages.Count > 0)
            {
                return(messages.Dequeue());
            }
            return(null);
        }
示例#3
0
        public void EnsureUniqueComponentSucceedsIfStageExecutionMethodIsNotAll()
        {
            var stage     = new Stage(StageCategory.DisassemblingParser.Id, PolicyFile.BTSReceivePolicy.Value);
            var component = new XmlDasmComp();

            stage.AddComponent(component);

            Action(() => stage.AddComponent(component)).Should().NotThrow();
        }
示例#4
0
        public void Xml_WithRIP()
        {
            IBaseComponent disassembler = Disassembler.Xml()
                                          .WithRecoverableInterchange(true).End();

            XmlDasmComp xml = disassembler as XmlDasmComp;

            Assert.AreEqual(true, xml.RecoverableInterchangeProcessing);
        }
示例#5
0
        public void Xml_WithValidation()
        {
            IBaseComponent disassembler = Disassembler.Xml()
                                          .WithValidation(true).End();

            XmlDasmComp xml = disassembler as XmlDasmComp;

            Assert.AreEqual(true, xml.ValidateDocument);
        }
示例#6
0
        public void Xml_CanAddEnvelopeSpec()
        {
            IBaseComponent disassembler = Disassembler.Xml()
                                          .WithEnvelopeSpec <SimpleEnv>().End();

            XmlDasmComp xml = disassembler as XmlDasmComp;

            Assert.AreEqual(1, xml.EnvelopeSpecNames.Count);
        }
示例#7
0
        public void Xml_CanAddDocumentSpec()
        {
            IBaseComponent disassembler = Disassembler.Xml()
                                          .WithDocumentSpec <Schema1_NPP>().End();

            XmlDasmComp xml = disassembler as XmlDasmComp;

            Assert.IsNotNull(xml);
            Assert.AreEqual(1, xml.DocumentSpecNames.Count);
        }
        public void Setup()
        {
            rcvpipeline = PipelineFactory.CreateEmptyReceivePipeline();
            XmlDasmComp xmlDasmComp = new XmlDasmComp();

            rcvpipeline.AddComponent(xmlDasmComp, PipelineStage.Disassemble);

            sndpipeline = PipelineFactory.CreateEmptySendPipeline();

            if (!File.Exists(googlecredentials))
            {
            }
        }
        /// <summary>
        /// Promotes properties defined in an XSD schema for an XML message.
        /// </summary>
        /// <param name="message">the XML message.</param>
        /// <param name="pc">Pipeline context.</param>
        /// <returns>The message with promoted properties.</returns>
        public static IBaseMessage PromotePropertiesBySchema(this IBaseMessage message, IPipelineContext pc)
        {
            // Write the PromotePropertiesOnly property on the message
            message.Context.Write("PromotePropertiesOnly", Resources.UriXmlNormProperties, true);

            var xmlDasmComp = new XmlDasmComp {
                AllowUnrecognizedMessage = true, ValidateDocument = false
            };

            xmlDasmComp.Disassemble(pc, message);
            var outMsg = xmlDasmComp.GetNext(pc);

            outMsg.BodyPart.Data.Position = 0;
            return(outMsg);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceMediationXmlDisassembler"/> class.
 /// </summary>
 public ServiceMediationXmlDisassembler()
     : base(ResourceManager)
 {
     this.serviceMediationDasm = new ServiceMediation();
     this.xmlDasmComp          = new XmlDasmComp();
 }
 public void CanAddComponentToValidStage()
 {
    ReceivePipelineWrapper pipeline = PipelineFactory.CreateEmptyReceivePipeline();
    IBaseComponent component = new XmlDasmComp();
    pipeline.AddComponent(component, PipelineStage.Disassemble);
 }
示例#12
0
 internal XmlDisassembler()
 {
     _disassembler = new XmlDasmComp();
 }
 private void SetXmlDasmProperties(XmlDasmComp pc)
 {
     pc.AllowUnrecognizedMessage = true;
 }