Exemple #1
0
        public virtual void ShouldProduceRightResultForResponse()
        {
            XmlToModelResult result = this.transformer.TransformFromHl7(MockVersionNumber.MOCK_NEWFOUNDLAND, this.factory.CreateFromResource
                                                                            (new ClasspathResource(this.GetType(), MESSAGE)));

            Assert.IsNotNull(result, "result");
            Assert.IsNotNull(result.GetMessageObject(), "bean");
            Assert.IsTrue(result.GetMessageObject() is FindCandidatesQueryMessageBean, "bean type");
        }
Exemple #2
0
        public IInteraction ConvertXMLToMessageObject(String xml, VersionNumber version)
        {
            IInteraction msg = null;

            MessageBeanTransformerImpl transformer = this.CreateTransformer();

            try
            {
                XmlToModelResult result = transformer.TransformFromHl7(version, new DocumentFactory().CreateFromString(xml));
                msg = (IInteraction)result.GetMessageObject();
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine("Exception in HelloWorldApp.Deserialize() method");
                throw new Exception(ex.ToString());
            }
            return(msg);
        }