Version 4.0.2

Build: 4.0.2-808

Release date: 02.05.19

This is a bug fix release of the SDK. It additionally contains some new features.

Changes to Common parts

  • New: NodeClass-based Identifiers and Ids-interfaces (e.g. DataTypeIdentifiers, DataTypeIds).

    Identifiers and generated Ids are now interfaces extending these. The changes are source-compatible with 4.0.0, as static constants are inherited. Allows overcoming Java limitations for maximum number of constants as the OPC UA Standard Information Model keeps growing.
  • New: UaRelativePath.from(NamespaceTable namespaceTable, QualifiedName…​ elements) static factory method.

  • New: UaRelativePath.from(UaNamespace namespace, String…​ elementNames) static factory method.

  • New: UaRelativePath.standard(String…​ elementNames) static factory method.

  • New: UaRelativePath.getElements(), can be used to obtain elements of the path.

  • New: UaQualifiedName.from(UaNamespace namespace, String name) static factory method.

  • New: UaQualifiedName.getNamespace(), which will return the namespace as UaNamespace

  • Fixed: Encoding order of DiagnosticInfo fields fixed, order of Locale and LocalizedText fields are swapped. Both are Int32 fields in this case, so binary format itself is unaffected.

  • Fixed: Renamed UnsignedLong.valueof(BigInteger) to valueOf.

  • Fixed: Bad_EncodingError when encoding a DynamicStructure that was inside a Variant.

Changes to Client SDK

  • Fixed: Connections to servers, that do not use an Application Instance Certificate and support only a combination of SecurityMode NONE, UserTokenPolicy Anonymous should now work again.

Changes to Server SDK

  • New: Creating StructureSpecification and EnumerationSpecification dynamically when loading NodeSets.

  • New: Loading custom Structure Values as DynamicStructures where possible when loading NodeSets (if the model is not code-generated).

    Currently only Structures made of known DataTypes work like this. A custom Structure having a custom Structure field does not work yet. We will improve this in the future.
  • Improvement: Avoiding extra encode&decode step when loading the model.

  • Fixed: MonitoredDataItems whose MonitoringMode is changed from Sampling to Reporting should not try to fetch the initial value again.

  • Changed: Loading NodeSets that incorrectly define HasTypeDefinition Reference for VariableType and ObjectType logs a warning instead of failing the loading completely.

  • Changed: Values that cannot be decoded during the NodeSet loading are kept as encoded ExtensionObjects instead of causing the loading to fail completely.

Changes to Code Generator

  • New: Generating NodeClass-based Ids-interfaces, e.g. DataTypeIds.

  • Changed: Generated Ids is now an interface instead of a class and extends all NodeClass-based Ids-interfaces.

Changes to SampleConsoleClient

  • New: -w Command line switch to wait at start until enter is pressed.

    Can be used for attaching a Profiler software before initial SDK classloading takes place.
  • Improved: Avoiding calling deprecated API.

Changes to SampleConsoleServer

  • New: -w Command line switch to wait at start until enter is pressed, same as with SampleConsoleClient.

  • Improved: Avoiding calling deprecated API.

  • Improved: Logging of the simulated alarms.


  • Maven integration project maven-install-helper will also install javadocs in addition of the SDK jar to your local .m2 Maven cache.

Plus a number of other small changes.

Version 4.0.0

Build: 4.0.0-774

Release date: 25.03.19

This is a new major release of the Prosys OPC UA SDK for Java.

The SDK version 4 is based on the OPC UA specification version 1.04. The 4.0.0 release adds support for the most important features, such as new security policies, information models and reverse connections. Other functionality specified in OPC UA 1.04 will be added later on.

Another major change is that the OPC UA Stack is now integrated as part of the SDK.

All users are encouraged to migrate to this new release, although the projects that depend on the OPC UA SDK need to be modified slightly according to the changes. To help you with the transition, we have prepared a Migration Guide that lists the required changes to your applications in detail.

We are proud to be able to provide this big release that will pave the way to reliable OPC UA applications for future needs.

Prosys OPC UA SDK Development Team

Feature Highlights

  • The official name of the product was changed to "Prosys OPC UA SDK for Java" and the names of the SDK jars have changed slightly as well.

  • OPC Foundation Java Stack is integrated as part of the SDK. It includes the OPC Foundation updates to 1.04 plus additional updates to improve the integration.

  • Support for OPC UA 1.04 Information Models.

  • Support for the new 1.04 Attributes in the client side.

  • Support for the new 1.04 DataTypeDefinition Attribute in the server side (support for other new 1.04 Attributes will be added later).

  • Support for the new 1.04 Security Policies: Aes128-Sha256-RsaOaep, Aes256-Sha256-RsaPss.

  • Support for Reverse Connections (using the new 'ReverseHello' message defined in OPC UA 1.04.).

  • Improved support for handling Structure data types in a generic way.

  • Support for Automatic-Module-Name for Java 9+.

  • Support Maven for installation of SDK and samples.

  • Fixed detection of Spongy Castle on Android.

  • Fixed HTTPS communications.

    The OPC UA Servers no longer validate the HTTPS certificates of clients. Therefore, if you have HTTPS enabled on the server, any client application may connect by default. The clients must use MessageSecurityMode Sign to enable authentication using Application Instance Certificates, similar to UA TCP. This behavior is defined in OPC UA Specification Part 6. OPC UA 1.04 also changed the format of HTTPS EndpointUrl to us 'opc.https' instead of 'https'. SDK 4.0 only supports the new format.

Changes to OPC UA Stack

The OPC UA Stack is now integrated as part of the Prosys OPC UA SDK. It is based on the open source OPC Foundation Java Stack, but based on our agreement with the OPC Foundation we can provide it under the Prosys OPC UA SDK license.

As a consequence, there is a new package that includes all classes that were in The OPC Foundation stack has been updated to support OPC UA 1.04 and on top of that we have added some of our own improvements.

Migration to the new stack should in principle only require renaming the package declarations in project source files. See the Migration Guide for more details.

  • New: Support for (most) new types defined in OPC UA 1.04.

  • New: Support for the new ReverseHello message defined in OPC UA 1.04.

  • New: Support for new security policies defined in 1.04

  • New: ReverseConnectionListener.

  • New: SecurityPolicy enum. Includes the new security policies defined in OPC UA 1.04. NOTE that Basic128Rsa15 and Basic256 are now deprecated and they are no longer recommended, except for backwards compatibility.

  • New: SecurityMode.combinations()

  • Removed: SecurityMode constants. Use the new constants in SecurityPolicy instead. ALL is no longer available: use the version specific constants instead.

  • Removed: SunJceCryptoProvider and SunJceCertificateProvider. They were not Java 9+ ready and also not 100% compatible. As a result BouncyCastle (or SpongyCastle in Android) is a mandatory dependency.

  • New: Support multidimensional arrays in Structure types

  • Removed: EncoderCalc.

  • New: LimitedByteArrayOutputStream and SizeCalculationOutputStream. Can be used with BinaryEncoder in situations where EncoderCalc was previously used.

  • New: Added static valueOf(String) method to the unsigned types to match jdk ones.

  • New: Support new 1.04 type Decimal by enable usage of Java BigDecimal in Variant and fields of Structure, for example.

  • New: A Builder class for each Structure.

  • New: EncoderContext.addEnumerationSpecification() and addStructureSpecification()

  • New: Static methods Variant.asObjectArray(Variant…​ variants) and Variant.asVariantArray(Object…​ objects).

  • Fixed: Use NamespaceIndex=0 instead of the UA Standard NamespaceUri for ExpandedNodeIds.

  • Fixed: Names of threads are more descriptive, and they can be configured. See StackUtils class.

  • Fixed: Handling of unknown built-in type IDs.

  • Fixed: Always use SpongyCastle in Android automatically.

  • Fixed: No more warnings from usage of reflection in Java 9+

  • Fixed: Possible memory leak after calling StackUtils.shutdown() and "restarting" the stack.

  • Removed ThreadGroups.

  • Changed: ExtensionObject now uses ByteString instead of byte[].

  • Changed: MultidimensionArrayUtils.toString() does not decode `ExtensionObjects by default.

  • Removed: XXXServiceSetHandler helper interfaces.

  • Deprecated: Constructors of UnsignedXXX types. Use static factory methods (valueOf) instead.

  • Deprecated: Constructor of StatusCode. Use static factory method StatusCode.valueOf instead.

  • Deprecated: Structure.getBinaryEncodeId, getJsonEncodeId, getTypeId & getXmlEncodeId. Use values available from the new Structure.specification() instead.

Changes to SDK common classes

  • New: Support for OPC UA 1.04 types.

  • Removed: Generated code and models for companion specifications (DI, ADI, PLCOpen).

  • Removed: PkiFileBasedCertificateValidator, PkiFileBasedCertificateListener, CertificateValidationListener, DefaultUaCertificateValidator, UaCertificateValidator. These were deprecated in version 3.x.

  • New: AccessLevelType replaces EnumSet<AccessLevel> in UaVariable.getAccessLevel(), etc.

  • New: EventNotifierType replaces EnumSet<EventNotifiedClass> in UaObject.getEventNotifier(), etc.

  • New: AttributeWriteMask replaces EnumSet<WriteAccess> in UaNode.getWriteMask(), etc.

  • Deprecated: Constructors of the UaAddress. Use static factory methods instead.

  • Deprecated: DataTypeConverter.getDataTypeForJavaClass(Class<?> clazz). Use getDataTypesForJavaClass() instead.

  • Deprecated: UaAddressSpace.findNode(). Use getNode() instead.

  • Changed: Append the certificate size to the file name of application instance certificates.

  • Changed: DataTypeConverter throws DataTypeConversionException instead of ServiceResultException.

  • Changed: UaValueNode.getDataType() returns UaDataType instead of UaType

  • Changed: StructureSpecification, FieldSpecification and EnumerationSpecification are now constructed via builders instead of constructors.

  • Fixed: Event types which had Object InstanceDeclarations with Properties now work properly.

  • New: UaNamespace. Used to model an OPC UA Namespace(URI).

  • New overload: UaNodeId.fromLocal(ExpandedNodeId expandedNodeId, NamespaceTable namespaceTable).

  • New: UaNodeId.getValueAsParseForm() and UaNodeId.parse(String namespaceUri, String valueAsParseForm). Can be used to store UaNodeId in files.

  • New: Automatically call registerModel() for generated information models by default.

  • New interface: BitField. All UnsignedXXX types implement this.

  • New: UaDataType.getDataTypeDefinition().

Changes to Client SDK

  • Fixed: Forward references of the Enumeration type.

  • Fixed: BrowseName of Guid type (was GUID)

  • Removed: Methods addChangeListener(), getDataChangeListeners(), hasChangeListener() and removeChangeListener() from MonitoredDataItem. These have been deprecated from 2.x.

  • Removed: UaFolder class. This was already deprecated in version 2.x. FolderType should be used instead.

  • Deprecated: UaClient methods: getHost(), getPort(), getProtocol(), getServerName() and getUri(). Use the respective methods of UaAddress instead.

  • Deprecated: UaClient.setUri(). Use UaClient.setAddress() instead.

  • Deprecated: AddressSpace.findNode(). Use getNode() instead.

  • Changed: Added missing Subscription parameter to SubscriptionNotificationListener.onMissingData

  • Changed: Added errorCode parameter to ServerStatusListener.onStatusChange(). Used, when status is null.

  • Changed: Async methods in AddressSpace and UaClient return the AsyncResult with a generics parameter matching the response type.

  • Changed: TypeDictionary now reads by default the dictionaries when connecting to the server. This can be toggled via Uaclient.setInitTypeDictionaryOnConnect(boolean).

  • New: TypeDictionary.getStructureSpecification(UaNodeId id), which can be used to obtain the StructureSpecification of the given id (type or encoding id).

  • New: TypeDictionary reads the new 1.04 DataTypeDefinition Attributes, if the server provides them.

  • New: UaClient.getAddress().

  • New: UaClient.setConnectTimeout(), can be used to set how long the initial connection (normal or reverse) is waited.

Changes to Server SDK

  • New: UaServer.addReverseConnection(String clientServerEndpointUrl, String endpointUrlForClientConnection). Enables support for Reverse Connections as mentioned in Feature Highlights.

  • New: NodeManagerUaNode.getDataType(NodeId dataTypeId).

  • New: Added support for SecurityMode for HTTPS connections. Note that only MessageSecurityModes None or Sign can be used.

  • New: SubscriptionManager.setMaxMonitoredItemsPerSubscription(int). Default is 1000.

  • Deprecated: UaServer.setSecurityModes(). Use UaServer.getSecurityModes().add() or UaServer.getSecurityModes().addAll() instead.

  • Deprecated: NodeManagerTable.findNode(), use getNode() instead.

  • Deprecated: NodeManager.findNode, use getNode() instead.

  • Changed: UaServer.getSecurityModes() returns a Set instead of an array of SecurityMode.

  • Changed: UaServer.getSecurityModes() is empty by default (used to initialize to `SecurityModes.ALL, which does not exist any more).

  • Changed: Added Boolean useSimpleBounds parameter to HistoryManagerListener.onReadAtTimes call.

  • Changed: InstanceDeclaration interface, methods returning Set<InstanceDeclaration> now return Set<? extends InstanceDeclaration>

  • Removed: InstanceDeclaration.getExternalReferences() and getInstanceReferences()

  • Changed: NodeManagerTable.addNode() now throws IllegalStateException if the the add operation fails.

  • Changed: Using 32 byte authentication tokens for Sessions.

  • Fixed: Symmetric ReferenceTypes now work properly.

  • Fixed: Possible multithreading issue in protected method SubscriptionManager.nextSubscriptionId()

  • Fixed: An issue where Diagnostics didn’t work if they were enabled before UaServer.start was called.

Changes to Code Generator

Running the code generator requires now (exactly) Java 8. A future version will also run on Java 11. The generated code will however compile on Java 6+.

  • Changed: Configuration file format. Please see the Codegen Manual and Migration Guide for details.

  • Changed: Namespace prefix is now applied also to the names of the generated DataTypeDictionaryHelper and Serializer output classes.

  • New: Support OPC UA 1.04 information models.

    OPC Foundation is releasing new amendments to the 1.04 specification. Specific companion specifications may rely on these amendments, so if you experience problems, please contact our support for assistance.
  • New: A static SPECIFICATION field is generated for each Structure. It contains the respective StructureSpecification.

  • New: A static SPECIFICATION field is generated for each Enumeration. It contains the respective EnumerationSpecification.

  • New: Generate code for subtypes of unsigned integer types that have OptionSetValues Property.

  • New: Support for multidimensional array fields for Structures (added in 1.04).

  • New: Support abstract Enumeration in InstanceDeclaration DataTypes (will return Enumeration in generated code).

  • New Generation Targets: client_model_provider and server_model_provider. UaClient and UaServer will be able to call registerModel automatically for these models (assuming the generated files are accessible via the classpath).

  • New: Detecting if an information model is used improperly as configuration file and reporting better error message.

Changes to SampleConsoleClient

  • New: Command line switch '-r' to open a port for reverse connection.

  • New: Added pom.xml for Maven integration.

  • Changed: Project layout to Maven Standard Directory Layout.

  • Changed: Removed generation of HTTPS certificate (not required).

Changes to SampleConsoleServer

  • New: Support new security policies defined in 1.04.

  • New: Support reverse connection.

  • New: Added pom.xml for Maven integration.

  • Changed: Project layout to Maven Standard Directory Layout.

  • Removed MyEnumType enum, converted the functionality to use EnumerationSpecification.

  • Fixed: Avoids NPE for the first read of NonUaNodeComplianceNodeManager.


  • For Maven users, A pom.xml for maven integration is now provided for the SDK jar. Addtionally the samples have their own pom.xml which should allow easier importing to IDEs. Note that you must first install the SDK pom file (with the jar) to your local .m2 repo, otherwise the pom.xml of the samples do not work.

  • For Java 9+ support, the SDK jar now includes Automatic-Module-Name in the MANIFEST.MF with value ''

  • Fixed DataTypeDictionary related Description node names for the SampleTypes model, which is bundled with the SDK Codegen.

  • Android detection should work better, for the purpose of automatically detecting if SpongyCastle based Crypto/Certificate providers should be used.

  • HTML manuals included in the distribution in addition to PDFs.

Plus a number of other small changes.