5 Data encoding ToC Previous Next

5.3 OPC UA XML ToC Previous Next

5.3.5 Structures ToC Previous Next

Structures are encoded as a xs:complexType with all of the fields appearing in a sequence. All fields are encoded as an xs:element. All elements have minOccurs set 0 to allow for compact XML representations. If an element is missing the default value for the field type is used. If the field type is a structure the default value is an instance of the structure with default values for each contained field.

Types which have a NULL value defined shall have the nillable=”true” flag set.

For example, the Read service has a ReadValueId structure in the request. The XML schema would look like:

<xs:complexType name="ReadValueId">
<xs:sequence>
<xs:element name="NodeId" type="tns:NodeId"
minOccurs="0" nillable="true" />
<xs:element name="AttributeId" type="xs:int" minOccurs="0" />
<xs:element name="IndexRange" type="xs:string"
minOccurs="0" nillable="true" />
<xs:element name="DataEncoding" type="tns:NodeId"
minOccurs="0" nillable="true" />
</xs:sequence>
</xs:complexType>

Previous Next