Search in sources :

Example 21 with OpcUaXmlStreamDecoder

use of org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder in project milo by eclipse.

the class VariableNodeLoader method loadNode485.

private void loadNode485() throws IOException, SAXException {
    PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_AddCertificate_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);
    node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_AddCertificate_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));
    node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_AddCertificate_InputArguments, Identifiers.HasProperty, Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_AddCertificate.expanded(), false));
    StringBuilder sb = new StringBuilder();
    sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier>          </TypeId><Body><Argument><Name>Certificate</Name><DataType><Identifier>i=15</Identifier>              </DataType><ValueRank>-1</ValueRank><ArrayDimensions/>            </Argument>          </Body>        </ExtensionObject><ExtensionObject><TypeId><Identifier>i=297</Identifier>          </TypeId><Body><Argument><Name>IsTrustedCertificate</Name><DataType><Identifier>i=1</Identifier>              </DataType><ValueRank>-1</ValueRank><ArrayDimensions/>            </Argument>          </Body>        </ExtensionObject>      </ListOfExtensionObject>");
    String xml = sb.toString();
    OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));
    Object o = decoder.readVariantValue();
    DataValue value = new DataValue(new Variant(o));
    node.setValue(value);
    this.nodeManager.addNode(node);
}
Also used : Variant(org.eclipse.milo.opcua.stack.core.types.builtin.Variant) DataValue(org.eclipse.milo.opcua.stack.core.types.builtin.DataValue) Reference(org.eclipse.milo.opcua.sdk.core.Reference) QualifiedName(org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName) StringReader(java.io.StringReader) PropertyTypeNode(org.eclipse.milo.opcua.sdk.server.model.nodes.variables.PropertyTypeNode) LocalizedText(org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText) OpcUaXmlStreamDecoder(org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder)

Example 22 with OpcUaXmlStreamDecoder

use of org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder in project milo by eclipse.

the class VariableNodeLoader method loadNode63.

private void loadNode63() throws IOException, SAXException {
    PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_Open_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);
    node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_Open_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));
    node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_Open_InputArguments, Identifiers.HasProperty, Identifiers.ServerConfiguration_CertificateGroups_DefaultApplicationGroup_TrustList_Open.expanded(), false));
    StringBuilder sb = new StringBuilder();
    sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier>          </TypeId><Body><Argument><Name>Mode</Name><DataType><Identifier>i=3</Identifier>              </DataType><ValueRank>-1</ValueRank><ArrayDimensions/>            </Argument>          </Body>        </ExtensionObject>      </ListOfExtensionObject>");
    String xml = sb.toString();
    OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));
    Object o = decoder.readVariantValue();
    DataValue value = new DataValue(new Variant(o));
    node.setValue(value);
    this.nodeManager.addNode(node);
}
Also used : Variant(org.eclipse.milo.opcua.stack.core.types.builtin.Variant) DataValue(org.eclipse.milo.opcua.stack.core.types.builtin.DataValue) Reference(org.eclipse.milo.opcua.sdk.core.Reference) QualifiedName(org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName) StringReader(java.io.StringReader) PropertyTypeNode(org.eclipse.milo.opcua.sdk.server.model.nodes.variables.PropertyTypeNode) LocalizedText(org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText) OpcUaXmlStreamDecoder(org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder)

Example 23 with OpcUaXmlStreamDecoder

use of org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder in project milo by eclipse.

the class VariableNodeLoader method loadNode400.

private void loadNode400() throws IOException, SAXException {
    PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Close_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);
    node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Close_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));
    node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Close_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));
    node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Close_InputArguments, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Close.expanded(), false));
    StringBuilder sb = new StringBuilder();
    sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier>          </TypeId><Body><Argument><Name>FileHandle</Name><DataType><Identifier>i=7</Identifier>              </DataType><ValueRank>-1</ValueRank><ArrayDimensions/>            </Argument>          </Body>        </ExtensionObject>      </ListOfExtensionObject>");
    String xml = sb.toString();
    OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));
    Object o = decoder.readVariantValue();
    DataValue value = new DataValue(new Variant(o));
    node.setValue(value);
    this.nodeManager.addNode(node);
}
Also used : Variant(org.eclipse.milo.opcua.stack.core.types.builtin.Variant) DataValue(org.eclipse.milo.opcua.stack.core.types.builtin.DataValue) Reference(org.eclipse.milo.opcua.sdk.core.Reference) QualifiedName(org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName) StringReader(java.io.StringReader) PropertyTypeNode(org.eclipse.milo.opcua.sdk.server.model.nodes.variables.PropertyTypeNode) LocalizedText(org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText) OpcUaXmlStreamDecoder(org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder)

Example 24 with OpcUaXmlStreamDecoder

use of org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder in project milo by eclipse.

the class VariableNodeLoader method loadNode99.

private void loadNode99() throws IOException, SAXException {
    DataTypeDescriptionTypeNode node = new DataTypeDescriptionTypeNode(this.context, Identifiers.OpcUa_BinarySchema_RelativePath, new QualifiedName(0, "RelativePath"), new LocalizedText("en", "RelativePath"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.String, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);
    node.addReference(new Reference(Identifiers.OpcUa_BinarySchema_RelativePath, Identifiers.HasTypeDefinition, Identifiers.DataTypeDescriptionType.expanded(), true));
    node.addReference(new Reference(Identifiers.OpcUa_BinarySchema_RelativePath, Identifiers.HasComponent, Identifiers.OpcUa_BinarySchema.expanded(), false));
    StringBuilder sb = new StringBuilder();
    sb.append("<String xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\">RelativePath</String>");
    String xml = sb.toString();
    OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));
    Object o = decoder.readVariantValue();
    DataValue value = new DataValue(new Variant(o));
    node.setValue(value);
    this.nodeManager.addNode(node);
}
Also used : Variant(org.eclipse.milo.opcua.stack.core.types.builtin.Variant) DataTypeDescriptionTypeNode(org.eclipse.milo.opcua.sdk.server.model.nodes.variables.DataTypeDescriptionTypeNode) DataValue(org.eclipse.milo.opcua.stack.core.types.builtin.DataValue) Reference(org.eclipse.milo.opcua.sdk.core.Reference) QualifiedName(org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName) StringReader(java.io.StringReader) LocalizedText(org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText) OpcUaXmlStreamDecoder(org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder)

Example 25 with OpcUaXmlStreamDecoder

use of org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder in project milo by eclipse.

the class VariableNodeLoader method loadNode469.

private void loadNode469() throws IOException, SAXException {
    PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Open_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);
    node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Open_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));
    node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Open_InputArguments, Identifiers.HasProperty, Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Open.expanded(), false));
    StringBuilder sb = new StringBuilder();
    sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier>          </TypeId><Body><Argument><Name>Mode</Name><DataType><Identifier>i=3</Identifier>              </DataType><ValueRank>-1</ValueRank><ArrayDimensions/>            </Argument>          </Body>        </ExtensionObject>      </ListOfExtensionObject>");
    String xml = sb.toString();
    OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));
    Object o = decoder.readVariantValue();
    DataValue value = new DataValue(new Variant(o));
    node.setValue(value);
    this.nodeManager.addNode(node);
}
Also used : Variant(org.eclipse.milo.opcua.stack.core.types.builtin.Variant) DataValue(org.eclipse.milo.opcua.stack.core.types.builtin.DataValue) Reference(org.eclipse.milo.opcua.sdk.core.Reference) QualifiedName(org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName) StringReader(java.io.StringReader) PropertyTypeNode(org.eclipse.milo.opcua.sdk.server.model.nodes.variables.PropertyTypeNode) LocalizedText(org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText) OpcUaXmlStreamDecoder(org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder)

Aggregations

OpcUaXmlStreamDecoder (org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder)244 StringReader (java.io.StringReader)243 Reference (org.eclipse.milo.opcua.sdk.core.Reference)243 DataValue (org.eclipse.milo.opcua.stack.core.types.builtin.DataValue)243 LocalizedText (org.eclipse.milo.opcua.stack.core.types.builtin.LocalizedText)243 QualifiedName (org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName)243 Variant (org.eclipse.milo.opcua.stack.core.types.builtin.Variant)243 PropertyTypeNode (org.eclipse.milo.opcua.sdk.server.model.nodes.variables.PropertyTypeNode)168 DataTypeDescriptionTypeNode (org.eclipse.milo.opcua.sdk.server.model.nodes.variables.DataTypeDescriptionTypeNode)73 DataTypeDictionaryTypeNode (org.eclipse.milo.opcua.sdk.server.model.nodes.variables.DataTypeDictionaryTypeNode)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 UaSerializationException (org.eclipse.milo.opcua.stack.core.UaSerializationException)1 OpcUaXmlDataTypeCodec (org.eclipse.milo.opcua.stack.core.serialization.codecs.OpcUaXmlDataTypeCodec)1 ExtensionObject (org.eclipse.milo.opcua.stack.core.types.builtin.ExtensionObject)1 XmlElement (org.eclipse.milo.opcua.stack.core.types.builtin.XmlElement)1 SAXException (org.xml.sax.SAXException)1