/// <summary>
        /// Saves the attributes from the stream.
        /// </summary>
        /// <param name="context">The context for the system being accessed.</param>
        /// <param name="encoder">The encoder wrapping the stream to write.</param>
        public override void Save(ISystemContext context, XmlEncoder encoder)
        {
            base.Save(context, encoder);

            encoder.PushNamespace(Namespaces.OpcUaXsd);

            if (!NodeId.IsNull(m_referenceTypeId))
            {
                encoder.WriteNodeId("ReferenceTypeId", m_referenceTypeId);
            }

            if (!NodeId.IsNull(m_typeDefinitionId))
            {
                encoder.WriteNodeId("TypeDefinitionId", m_typeDefinitionId);
            }

            if (!NodeId.IsNull(m_modellingRuleId))
            {
                encoder.WriteNodeId("ModellingRuleId", m_modellingRuleId);
            }

            if (m_numericId != 0)
            {
                encoder.WriteUInt32("NumericId", m_numericId);
            }

            encoder.PopNamespace();
        }
Example #2
0
        /// <summary>
        /// Saves the attributes from the stream.
        /// </summary>
        /// <param name="context">The context for the system being accessed.</param>
        /// <param name="encoder">The encoder wrapping the stream to write.</param>
        public override void Save(ISystemContext context, XmlEncoder encoder)
        {
            base.Save(context, encoder);

            encoder.PushNamespace(Namespaces.OpcUaXsd);

            if (m_value != null)
            {
                encoder.WriteVariant("Value", WrappedValue);
            }

            if (!NodeId.IsNull(DataType))
            {
                encoder.WriteNodeId("DataType", DataType);
            }

            if (ValueRank != ValueRanks.Any)
            {
                encoder.WriteInt32("ValueRank", ValueRank);
            }

            if (ArrayDimensions != null)
            {
                encoder.WriteString("ArrayDimensions", BaseVariableState.ArrayDimensionsToXml(ArrayDimensions));
            }

            encoder.PopNamespace();
        }
        /// <summary>
        /// Writes a message in SOAP/XML.
        /// </summary>
        public static void WriteSoapMessage(
            Stream ostrm,
            string typeName,
            IEncodeable message,
            ServiceMessageContext messageContext)
        {
            XmlWriterSettings settings = new XmlWriterSettings();

            settings.Encoding           = System.Text.Encoding.UTF8;
            settings.OmitXmlDeclaration = false;

            XmlWriter writer = XmlWriter.Create(ostrm, settings);

            writer.WriteStartElement("soap12", "Envelope", "http://www.w3.org/2003/05/soap-envelope");

            XmlEncoder encoder = new XmlEncoder(
                new XmlQualifiedName("Body", "http://www.w3.org/2003/05/soap-envelope"),
                writer,
                messageContext);

            encoder.PushNamespace(Namespaces.OpcUaXsd);

            encoder.WriteEncodeable(
                typeName,
                message,
                null);

            encoder.PopNamespace();

            writer.WriteEndElement();
            writer.WriteEndElement();
            writer.Flush();
        }
Example #4
0
        /// <summary>
        /// Saves the attributes from the stream.
        /// </summary>
        /// <param name="context">The context for the system being accessed.</param>
        /// <param name="encoder">The encoder wrapping the stream to write.</param>
        public override void Save(ISystemContext context, XmlEncoder encoder)
        {
            base.Save(context, encoder);

            encoder.PushNamespace(Namespaces.OpcUaXsd);

            if (m_dataTypeDefinition != null)
            {
                encoder.WriteExtensionObject("DataTypeDefinition", m_dataTypeDefinition);
            }

            encoder.PopNamespace();
        }
Example #5
0
        /// <summary>
        /// Saves the attributes from the stream.
        /// </summary>
        /// <param name="context">The context for the system being accessed.</param>
        /// <param name="encoder">The encoder wrapping the stream to write.</param>
        public override void Save(ISystemContext context, XmlEncoder encoder)
        {
            base.Save(context, encoder);

            encoder.PushNamespace(Namespaces.OpcUaXsd);

            if (m_eventNotifier != 0)
            {
                encoder.WriteByte("EventNotifier", m_eventNotifier);
            }

            encoder.PopNamespace();
        }
Example #6
0
        /// <summary>
        /// Saves the attributes from the stream.
        /// </summary>
        /// <param name="context">The context for the system being accessed.</param>
        /// <param name="encoder">The encoder wrapping the stream to write.</param>
        public override void Save(ISystemContext context, XmlEncoder encoder)
        {
            base.Save(context, encoder);

            encoder.PushNamespace(Namespaces.OpcUaXsd);

            if (!NodeId.IsNull(m_superTypeId))
            {
                encoder.WriteNodeId("SuperTypeId", m_superTypeId);
            }

            if (m_isAbstract)
            {
                encoder.WriteBoolean("IsAbstract", m_isAbstract);
            }

            encoder.PopNamespace();
        }
Example #7
0
        /// <summary>
        /// Saves the attributes from the stream.
        /// </summary>
        /// <param name="context">The context for the system being accessed.</param>
        /// <param name="encoder">The encoder wrapping the stream to write.</param>
        public override void Save(ISystemContext context, XmlEncoder encoder)
        {
            base.Save(context, encoder);

            encoder.PushNamespace(Namespaces.OpcUaXsd);

            if (m_executable)
            {
                encoder.WriteBoolean("Executable", m_executable);
            }

            if (m_userExecutable)
            {
                encoder.WriteBoolean("UserExecutable", m_executable);
            }

            encoder.PopNamespace();
        }
Example #8
0
        /// <summary>
        /// Saves the attributes from the stream.
        /// </summary>
        /// <param name="context">The context for the system being accessed.</param>
        /// <param name="encoder">The encoder wrapping the stream to write.</param>
        public override void Save(ISystemContext context, XmlEncoder encoder)
        {
            base.Save(context, encoder);

            encoder.PushNamespace(Namespaces.OpcUaXsd);

            if (!LocalizedText.IsNullOrEmpty(m_inverseName))
            {
                encoder.WriteLocalizedText("InverseName", m_inverseName);
            }

            if (m_symmetric)
            {
                encoder.WriteBoolean("Symmetric", m_symmetric);
            }

            encoder.PopNamespace();
        }
        /// <summary>
        /// Writes a message in SOAP/XML.
        /// </summary>
        public static void WriteSoapMessage(
            Stream ostrm, 
            string typeName, 
            IEncodeable message, 
            ServiceMessageContext messageContext)
        {
            XmlWriterSettings settings = new XmlWriterSettings();
            settings.Encoding = System.Text.Encoding.UTF8;
            settings.OmitXmlDeclaration = false;

            XmlWriter writer = XmlWriter.Create(ostrm, settings);
            writer.WriteStartElement("soap12", "Envelope", "http://www.w3.org/2003/05/soap-envelope");

            XmlEncoder encoder = new XmlEncoder(
                new XmlQualifiedName("Body", "http://www.w3.org/2003/05/soap-envelope"),
                writer,
                messageContext);

            encoder.PushNamespace(Namespaces.OpcUaXsd);

            encoder.WriteEncodeable(
                typeName,
                message,
                null);

            encoder.PopNamespace();

            writer.WriteEndElement();
            writer.WriteEndElement();
            writer.Flush();
        }