Added Non Reversable JSON Encoding

Signed-off-by: mako752 <Akos.Makovics@sigmatechnology.se>
diff --git a/src/OpcUa_Common.ttcn b/src/OpcUa_Common.ttcn
index 1197bc5..01573c4 100644
--- a/src/OpcUa_Common.ttcn
+++ b/src/OpcUa_Common.ttcn
@@ -1,147 +1,147 @@
-/////////////////////////////////////////////////////////////////////////////////////

-// Copyright (c) 2017-2018  Ericsson AB

-// All rights reserved. This program and the accompanying materials

-// are made available under the terms of the Eclipse Public License v1.0

-// which accompanies this distribution, and is available at

-// http://www.eclipse.org/legal/epl-v10.html

-/////////////////////////////////////////////////////////////////////////////////////

-// Contributors:

-// Akos Makovics

-//

-//  File:         UpcUa_Common.ttcn

-//  Rev:          <RnXnn>

-//  Prodnr:       CNL113861

-/////////////////////////////////////////////////////////////////////////////////////

-

-module OpcUa_Common {

-

-  const integer Bad_TcpServerTooBusy := 2155675648;                     //0x807D0000, The server cannot process the request because it is too busy.

-  const integer Bad_TcpMessageTypeInvalid := 2155741184;                //0x807E0000, The type of the message specified in the header invalid.

-  const integer Bad_TcpSecureChannelUnknown := 2155806720;              //0x807F0000, The SecureChannelId and/or TokenId are not currently in use.

-  const integer Bad_TcpMessageTooLarge := 2155872256;                   //0x80800000, The size of the message specified in the header is too large.

-  const integer Bad_Timeout := 2148139008;                              //0x800A0000, The operation timed out.

-  const integer Bad_TcpNotEnoughResources := 2155937792;                //0x80810000, There are not enough resources to process the request.

-  const integer Bad_TcpInternalError := 2156003328;                     //0x80820000, An internal error occurred.

-  const integer Bad_TcpEndpointUrlInvalid := 2156068864;                //0x80830000, The Server does not recognize the QueryString specified.

-  const integer Bad_SecurityChecksFailed := 2148728832;                 //0x80130000, An error occurred verifying security.

-  const integer Bad_RequestInterrupted := 2156134400;                   //0x80840000, The request could not be sent because of a network interruption.

-  const integer Bad_RequestTimeout := 2156199936;                       //0x80850000, Timeout occurred while processing the request.

-  const integer Bad_SecureChannelClosed := 2156265472;                  //0x80860000, The secure channel has been closed.

-  const integer Bad_SecureChannelTokenUnknown := 2156331008;            //0x80870000, The token has expired or is not recognized.

-  const integer Bad_CertificateUntrusted := 2156396544;                 //0x80880000, The sequence number is not valid.

-  const integer Bad_CertificateTimeInvalid := 2148794368;               //0x80140000, The Certificate has expired or is not yet valid.

-  const integer Bad_CertificateIssuerTimeInvalid := 2148859904;         //0x80150000, An Issuer Certificate has expired or is not yet valid.

-  const integer Bad_CertificateUseNotAllowed := 2149056512;             //0x80180000, The Certificate may not be used for the requested operation.

-  const integer Bad_CertificateIssuerUseNotAllowed := 2149122048;       //0x80190000, The Issuer Certificate may not be used for the requested operation.

-  const integer Bad_CertificateRevocationUnknown := 2149253120;         //0x801B0000, It was not possible to determine if the Certificate has been revoked.

-  const integer Bad_CertificateIssuerRevocationUnknown := 2149318656;   //0x801C0000, It was not possible to determine if the Issuer Certificate has been revoked.

-  const integer Bad_CertificateRevoked := 2149384192;                   //0x801D0000, The certificate has been revoked.

-

-  type enumerated CommonServiceResultCodes {

-    Good,

-    Good_CompletesAsynchronously,

-    Good_SubscriptionTransferred,

-    Bad_CertificateHostNameInvalid,

-    Bad_CertificateChainIncomplete,

-    Bad_CertificateIssuerRevocationUnknown,

-    Bad_CertificateIssuerUseNotAllowed,

-    Bad_CertificateIssuerTimeInvalid,

-    Bad_CertificateIssuerRevoked,

-    Bad_CertificateInvalid,

-    Bad_CertificateRevocationUnknown,

-    Bad_CertificateRevoked,

-    Bad_CertificateTimeInvalid,

-    Bad_CertificateUriInvalid,

-    Bad_CertificateUntrusted,

-    Bad_CertificateUseNotAllowed,

-    Bad_CommunicationError,

-    Bad_DataTypeIdUnknown,

-    Bad_DecodingError,

-    Bad_EncodingError,

-    Bad_EncodingLimitsExceeded,

-    Bad_IdentityTokenInvalid,

-    Bad_IdentityTokenRejected,

-    Bad_InternalError,

-    Bad_InvalidArgument,

-    Bad_InvalidState,

-    Bad_InvalidTimestamp,

-    Bad_LicenseExpired,

-    Bad_LicenseLimitsExceeded,

-    Bad_LicenseNotAvailable,

-    Bad_NothingToDo,

-    Bad_OutOfMemory,

-    Bad_RequestCancelledByClient,

-    Bad_RequestTooLarge,

-    Bad_ResponseTooLarge,

-    Bad_RequestHeaderInvalid,

-    Bad_ResourceUnavailable,

-    Bad_SecureChannelIdInvalid,

-    Bad_SecurityChecksFailed,

-    Bad_ServerHalted,

-    Bad_ServerNotConnected,

-    Bad_ServerUriInvalid,

-    Bad_ServiceUnsupported,

-    Bad_SessionIdInvalid,

-    Bad_SessionClosed,

-    Bad_SessionNotActivated,

-    Bad_Shutdown,

-    Bad_SubscriptionIdInvalid,

-    Bad_Timeout,

-    Bad_TimestampsToReturnInvalid,

-    Bad_TooManyOperations,

-    Bad_UnexpectedError,

-    Bad_UnknownResponse,

-    Bad_UserAccessDenied,

-    Bad_ViewIdUnknown,

-    Bad_ViewTimestampInvalid,

-    Bad_ViewParameterMismatchInvalid,

-    Bad_ViewVersionInvalid

-  }

-

-  type enumerated CommonOperationLevelResultCodes {

-    Good_Clamped,

-    Good_Overload,

-    Uncertain,

-    Bad,

-    Bad_AttributeIdInvalid,

-    Bad_BrowseDirectionInvalid,

-    Bad_BrowseNameInvalid,

-    Bad_ContentFilterInvalid,

-    Bad_ContinuationPointInvalid,

-    Bad_DataEncodingInvalid,

-    Bad_DataEncodingUnsupported,

-    Bad_EventFilterInvalid,

-    Bad_FilterNotAllowed,

-    Bad_FilterOperandInvalid,

-    Bad_HistoryOperationInvalid,

-    Bad_HistoryOperationUnsupported,

-    Bad_IndexRangeInvalid,

-    Bad_IndexRangeNoData,

-    Bad_MonitoredItemFilterInvalid,

-    Bad_MonitoredItemFilterUnsupported,

-    Bad_MonitoredItemIdInvalid,

-    Bad_MonitoringModeInvalid,

-    Bad_NoCommunication,

-    Bad_NoContinuationPoints,

-    Bad_NodeClassInvalid,

-    Bad_NodeIdInvalid,

-    Bad_NodeIdUnknown,

-    Bad_NoDeleteRights,

-    Bad_NodeNotInView,

-    Bad_NotFound,

-    Bad_NotImplemented,

-    Bad_NotReadable,

-    Bad_NotSupported,

-    Bad_NotWritable,

-    Bad_ObjectDeleted,

-    Bad_OutOfRange,

-    Bad_ReferenceTypeIdInvalid,

-    Bad_SecurityModeInsufficient,

-    Bad_SourceNodeIdInvalid,

-    Bad_StructureMissing,

-    Bad_TargetNodeIdInvalid,

-    Bad_TypeDefinitionInvalid,

-    Bad_TypeMismatch,

-    Bad_WaitingForInitialData

-  }

-}

+/////////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2017-2018  Ericsson AB
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+/////////////////////////////////////////////////////////////////////////////////////
+// Contributors:
+// Akos Makovics
+//
+//  File:         UpcUa_Common.ttcn
+//  Rev:          <RnXnn>
+//  Prodnr:       CNL113861
+/////////////////////////////////////////////////////////////////////////////////////
+
+module OpcUa_Common {
+
+  const integer Bad_TcpServerTooBusy := 2155675648;                     //0x807D0000, The server cannot process the request because it is too busy.
+  const integer Bad_TcpMessageTypeInvalid := 2155741184;                //0x807E0000, The type of the message specified in the header invalid.
+  const integer Bad_TcpSecureChannelUnknown := 2155806720;              //0x807F0000, The SecureChannelId and/or TokenId are not currently in use.
+  const integer Bad_TcpMessageTooLarge := 2155872256;                   //0x80800000, The size of the message specified in the header is too large.
+  const integer Bad_Timeout := 2148139008;                              //0x800A0000, The operation timed out.
+  const integer Bad_TcpNotEnoughResources := 2155937792;                //0x80810000, There are not enough resources to process the request.
+  const integer Bad_TcpInternalError := 2156003328;                     //0x80820000, An internal error occurred.
+  const integer Bad_TcpEndpointUrlInvalid := 2156068864;                //0x80830000, The Server does not recognize the QueryString specified.
+  const integer Bad_SecurityChecksFailed := 2148728832;                 //0x80130000, An error occurred verifying security.
+  const integer Bad_RequestInterrupted := 2156134400;                   //0x80840000, The request could not be sent because of a network interruption.
+  const integer Bad_RequestTimeout := 2156199936;                       //0x80850000, Timeout occurred while processing the request.
+  const integer Bad_SecureChannelClosed := 2156265472;                  //0x80860000, The secure channel has been closed.
+  const integer Bad_SecureChannelTokenUnknown := 2156331008;            //0x80870000, The token has expired or is not recognized.
+  const integer Bad_CertificateUntrusted := 2156396544;                 //0x80880000, The sequence number is not valid.
+  const integer Bad_CertificateTimeInvalid := 2148794368;               //0x80140000, The Certificate has expired or is not yet valid.
+  const integer Bad_CertificateIssuerTimeInvalid := 2148859904;         //0x80150000, An Issuer Certificate has expired or is not yet valid.
+  const integer Bad_CertificateUseNotAllowed := 2149056512;             //0x80180000, The Certificate may not be used for the requested operation.
+  const integer Bad_CertificateIssuerUseNotAllowed := 2149122048;       //0x80190000, The Issuer Certificate may not be used for the requested operation.
+  const integer Bad_CertificateRevocationUnknown := 2149253120;         //0x801B0000, It was not possible to determine if the Certificate has been revoked.
+  const integer Bad_CertificateIssuerRevocationUnknown := 2149318656;   //0x801C0000, It was not possible to determine if the Issuer Certificate has been revoked.
+  const integer Bad_CertificateRevoked := 2149384192;                   //0x801D0000, The certificate has been revoked.
+
+  type enumerated CommonServiceResultCodes {
+    Good,
+    Good_CompletesAsynchronously,
+    Good_SubscriptionTransferred,
+    Bad_CertificateHostNameInvalid,
+    Bad_CertificateChainIncomplete,
+    Bad_CertificateIssuerRevocationUnknown,
+    Bad_CertificateIssuerUseNotAllowed,
+    Bad_CertificateIssuerTimeInvalid,
+    Bad_CertificateIssuerRevoked,
+    Bad_CertificateInvalid,
+    Bad_CertificateRevocationUnknown,
+    Bad_CertificateRevoked,
+    Bad_CertificateTimeInvalid,
+    Bad_CertificateUriInvalid,
+    Bad_CertificateUntrusted,
+    Bad_CertificateUseNotAllowed,
+    Bad_CommunicationError,
+    Bad_DataTypeIdUnknown,
+    Bad_DecodingError,
+    Bad_EncodingError,
+    Bad_EncodingLimitsExceeded,
+    Bad_IdentityTokenInvalid,
+    Bad_IdentityTokenRejected,
+    Bad_InternalError,
+    Bad_InvalidArgument,
+    Bad_InvalidState,
+    Bad_InvalidTimestamp,
+    Bad_LicenseExpired,
+    Bad_LicenseLimitsExceeded,
+    Bad_LicenseNotAvailable,
+    Bad_NothingToDo,
+    Bad_OutOfMemory,
+    Bad_RequestCancelledByClient,
+    Bad_RequestTooLarge,
+    Bad_ResponseTooLarge,
+    Bad_RequestHeaderInvalid,
+    Bad_ResourceUnavailable,
+    Bad_SecureChannelIdInvalid,
+    Bad_SecurityChecksFailed,
+    Bad_ServerHalted,
+    Bad_ServerNotConnected,
+    Bad_ServerUriInvalid,
+    Bad_ServiceUnsupported,
+    Bad_SessionIdInvalid,
+    Bad_SessionClosed,
+    Bad_SessionNotActivated,
+    Bad_Shutdown,
+    Bad_SubscriptionIdInvalid,
+    Bad_Timeout,
+    Bad_TimestampsToReturnInvalid,
+    Bad_TooManyOperations,
+    Bad_UnexpectedError,
+    Bad_UnknownResponse,
+    Bad_UserAccessDenied,
+    Bad_ViewIdUnknown,
+    Bad_ViewTimestampInvalid,
+    Bad_ViewParameterMismatchInvalid,
+    Bad_ViewVersionInvalid
+  }
+
+  type enumerated CommonOperationLevelResultCodes {
+    Good_Clamped,
+    Good_Overload,
+    Uncertain,
+    Bad,
+    Bad_AttributeIdInvalid,
+    Bad_BrowseDirectionInvalid,
+    Bad_BrowseNameInvalid,
+    Bad_ContentFilterInvalid,
+    Bad_ContinuationPointInvalid,
+    Bad_DataEncodingInvalid,
+    Bad_DataEncodingUnsupported,
+    Bad_EventFilterInvalid,
+    Bad_FilterNotAllowed,
+    Bad_FilterOperandInvalid,
+    Bad_HistoryOperationInvalid,
+    Bad_HistoryOperationUnsupported,
+    Bad_IndexRangeInvalid,
+    Bad_IndexRangeNoData,
+    Bad_MonitoredItemFilterInvalid,
+    Bad_MonitoredItemFilterUnsupported,
+    Bad_MonitoredItemIdInvalid,
+    Bad_MonitoringModeInvalid,
+    Bad_NoCommunication,
+    Bad_NoContinuationPoints,
+    Bad_NodeClassInvalid,
+    Bad_NodeIdInvalid,
+    Bad_NodeIdUnknown,
+    Bad_NoDeleteRights,
+    Bad_NodeNotInView,
+    Bad_NotFound,
+    Bad_NotImplemented,
+    Bad_NotReadable,
+    Bad_NotSupported,
+    Bad_NotWritable,
+    Bad_ObjectDeleted,
+    Bad_OutOfRange,
+    Bad_ReferenceTypeIdInvalid,
+    Bad_SecurityModeInsufficient,
+    Bad_SourceNodeIdInvalid,
+    Bad_StructureMissing,
+    Bad_TargetNodeIdInvalid,
+    Bad_TypeDefinitionInvalid,
+    Bad_TypeMismatch,
+    Bad_WaitingForInitialData
+  }
+}
diff --git a/src/OpcUa_Functions_JSON.ttcn b/src/OpcUa_Functions_JSON_Non_Reversible.ttcn
similarity index 98%
copy from src/OpcUa_Functions_JSON.ttcn
copy to src/OpcUa_Functions_JSON_Non_Reversible.ttcn
index a547c42..cadc75a 100644
--- a/src/OpcUa_Functions_JSON.ttcn
+++ b/src/OpcUa_Functions_JSON_Non_Reversible.ttcn
@@ -13,9 +13,9 @@
 //  Prodnr:       CNL113861
 /////////////////////////////////////////////////////////////////////////////////////
 
-module OpcUa_Functions_JSON {
+module OpcUa_Functions_JSON_Non_Reversible {
 
-  import from OpcUa_Types_JSON_Reversible all;
+  import from OpcUa_Types_JSON_Non_Reversible all;
 
   function f_CalculateSize(in MessageTypes pl_in) return integer {
     var octetstring encoded := enc_MessageTypes(pl_in);
diff --git a/src/OpcUa_Functions_JSON.ttcn b/src/OpcUa_Functions_JSON_Reversible.ttcn
similarity index 99%
rename from src/OpcUa_Functions_JSON.ttcn
rename to src/OpcUa_Functions_JSON_Reversible.ttcn
index a547c42..c5d1006 100644
--- a/src/OpcUa_Functions_JSON.ttcn
+++ b/src/OpcUa_Functions_JSON_Reversible.ttcn
@@ -1,4 +1,4 @@
-/////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////
 // Copyright (c) 2017-2018  Ericsson AB
 // All rights reserved. This program and the accompanying materials
 // are made available under the terms of the Eclipse Public License v1.0
@@ -13,7 +13,7 @@
 //  Prodnr:       CNL113861
 /////////////////////////////////////////////////////////////////////////////////////
 
-module OpcUa_Functions_JSON {
+module OpcUa_Functions_JSON_Reversible {
 
   import from OpcUa_Types_JSON_Reversible all;
 
diff --git a/src/OpcUa_Templates_Binary.ttcn b/src/OpcUa_Templates_Binary.ttcn
index 1727ab5..c2f6845 100644
--- a/src/OpcUa_Templates_Binary.ttcn
+++ b/src/OpcUa_Templates_Binary.ttcn
@@ -1,1379 +1,1379 @@
-/////////////////////////////////////////////////////////////////////////////////////

-// Copyright (c) 2017-2018  Ericsson AB

-// All rights reserved. This program and the accompanying materials

-// are made available under the terms of the Eclipse Public License v1.0

-// which accompanies this distribution, and is available at

-// http://www.eclipse.org/legal/epl-v10.html

-/////////////////////////////////////////////////////////////////////////////////////

-// Contributors:

-// Akos Makovics

-//

-//  File:         UpcUa_Templates_Binary.ttcn

-//  Rev:          <RnXnn>

-//  Prodnr:       CNL113861

-/////////////////////////////////////////////////////////////////////////////////////

-

-

-module OpcUa_Templates_Binary {

-

-  import from OpcUa_Types_Binary all;

-

-  /////////////////////////////////////////////////////////////

-  //                      Templates                          //

-  //      Note: Not every type has a template, and           //

-  //       some types may have multiple templates.           //

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                   Complex Types                         //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  //String with a value

-  template String tr_String (

-    charstring stringValue

-  ):= {

-    realString := {

-      stringLength := 0,

-      stringValue := stringValue

-    }

-  }

-

-  //Null String

-  template String tr_StringNull := {

-    nullString := {

-      arrayLength := Null_Value

-    }

-  }

-

-  //ByteString with a value

-  template ByteString tr_ByteString (

-    ByteArray arrayValue

-  ):= {

-    realByteString := {

-      lengthValue := 0,

-      byteStringValue := arrayValue

-    }

-  }

-

-  //Null ByteString

-  template ByteString tr_ByteStringNull := {

-    nullByteString := {

-      arrayLength := Null_Value

-    }

-  }

-

-  //A two byte Node ID

-  template NodeId tr_NodeIdTwoByte (

-    Byte nodeValue

-  ) := {

-    mask := 0,

-    namespaceUriBit := 0,

-    serverIndexBit := 0,

-    reservedBit1 := 0,

-    reservedBit2 := 0,

-    IdType := {

-      twoByte := {

-        nodeValue := nodeValue

-      }

-    }

-  }

-

-  //A four byte Node ID

-  template NodeId tr_NodeIdFourByte (

-    Byte nameSpace,

-    UInt16 nodeValue

-  ) := {

-    mask := 1,

-    namespaceUriBit := 0,

-    serverIndexBit := 0,

-    reservedBit1 := 0,

-    reservedBit2 := 0,

-    IdType := {

-      fourByte := {

-        nameSpace := nameSpace,

-        nodeValue := nodeValue

-      }

-    }

-  }

-

-  //A numeric Node ID

-  template NodeId tr_NodeIdNumeric (

-    Byte nameSpace,

-    UInt32 nodeValue

-  ) := {

-    mask := 2,

-    namespaceUriBit := 0,

-    serverIndexBit := 0,

-    reservedBit1 := 0,

-    reservedBit2 := 0,

-    IdType := {

-      fourByte := {

-        nameSpace := nameSpace,

-        nodeValue := nodeValue

-      }

-    }

-  }

-

-  //A string Node ID

-  template NodeId tr_NodeIdString (

-    UInt16 nameSpace,

-    String nodeValue

-  ) := {

-    mask := 3,

-    namespaceUriBit := 0,

-    serverIndexBit := 0,

-    reservedBit1 := 0,

-    reservedBit2 := 0,

-    IdType := {

-      string := {

-        nameSpace := nameSpace,

-        nodeValue := nodeValue

-      }

-    }

-  }

-

-  //A guid Node ID

-  template NodeId tr_NodeIdGuid (

-    UInt16 nameSpace,

-    Guid nodeValue

-  ) := {

-    mask := 4,

-    namespaceUriBit := 0,

-    serverIndexBit := 0,

-    reservedBit1 := 0,

-    reservedBit2 := 0,

-    IdType := {

-      guid := {

-        nameSpace := nameSpace,

-        nodeValue := nodeValue

-      }

-    }

-  }

-

-  //A ByteString Node ID

-  template NodeId tr_NodeIdByteString (

-    UInt16 nameSpace,

-    ByteString nodeValue

-  ) := {

-    mask := 5,

-    namespaceUriBit := 0,

-    serverIndexBit := 0,

-    reservedBit1 := 0,

-    reservedBit2 := 0,

-    IdType := {

-      byteString := {

-        nameSpace := nameSpace,

-        nodeValue := nodeValue

-      }

-    }

-  }

-

-  //A variant type with a single value

-  template Variant tr_Variant (

-    VariantSingleValue ValueSingle

-  ) := {

-    encodingBits := 0, //Encoder will assign proper value

-    arrayDimensionsBit := 0,

-    arrayEncodedBit := 0,

-    arrayLength := omit,

-    ValueSingle := ValueSingle,

-    ValueArray := omit,

-    arrayDimensionsLenght := omit,

-    arrayDimensions := omit

-  }

-

-  //A variant type with an array value

-  template Variant tr_VariantArray (

-    integer arrayLength,

-    VariantArrayValue ValueArray

-  ) := {

-    encodingBits := 0, //Encoder will assign proper value

-    arrayDimensionsBit := 0,

-    arrayEncodedBit := 1,

-    arrayLength := arrayLength,

-    ValueSingle := omit,

-    ValueArray := ValueArray,

-    arrayDimensionsLenght := omit,

-    arrayDimensions := omit

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                 Lists and Arrays                        //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  template NullArray tr_NullArray := {

-    arrayLength := Null_Value

-  }

-

-  template ListOfBoolean tr_ListOfBooleanNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfBoolean tr_ListOfBoolean (

-    BooleanArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfSByte tr_ListOfSByteNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfSByte tr_ListOfSByte (

-    SByteArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfByte tr_ListOfByteNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfByte tr_ListOfByte (

-    ByteArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfInt16 tr_ListOfInt16Null := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfInt16 tr_ListOfInt16 (

-    Int16Array values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfUInt16 tr_ListOfUInt16Null := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfUInt16 tr_ListOfUInt16 (

-    UInt16Array values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfInt32 tr_ListOfInt32Null := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfInt32 tr_ListOfInt32 (

-    Int32Array values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfUInt32 tr_ListOfUInt32Null := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfUInt32 tr_ListOfUInt32 (

-    UInt32Array values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfInt64 tr_ListOfInt64Null := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfInt64 tr_ListOfInt64 (

-    Int64Array values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfUInt64 tr_ListOfUInt64Null := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfUInt64 tr_ListOfUInt64 (

-    UInt64Array values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfFloat tr_ListOfFloatNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfFloat tr_ListOfFloat (

-    FloatArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfDouble tr_ListOfDoubleNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfDouble tr_ListOfDouble (

-    DoubleArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfDateTime tr_ListOfDateTimeNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfDateTime tr_ListOfDateTime (

-    DateTimeArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfUtcTime tr_ListOfUtcTimeNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfUtcTime tr_ListOfUtcTime (

-    UtcTimeArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfCounter tr_ListOfCounterNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfCounter tr_ListOfCounter (

-    CounterArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfIntegerId tr_ListOfIntegerIdNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfIntegerId tr_ListOfIntegerId (

-    IntegerIdArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfLocaleId tr_ListOfLocaleIdNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfLocaleId tr_ListOfLocaleId (

-    LocaleIdArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfContinuationPoint tr_ListOfContinuationPointNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfContinuationPoint tr_ListOfContinuationPoint (

-    ContinuationPointArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfString tr_ListOfStringNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfString tr_ListOfString (

-    StringArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfGuid tr_ListOfGuidNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfGuid tr_ListOfGuid (

-    GuidArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfByteString tr_ListOfByteStringNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfByteString tr_ListOfByteString (

-    ByteStringArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfXmlElement tr_ListOfXmlElementNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfXmlElement tr_ListOfXmlElement (

-    XmlElementArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfNodeId tr_ListOfNodeIdNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfNodeId tr_ListOfNodeId (

-    NodeIdArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfExpandedNodeId tr_ListOfExpandedNodeIdNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfExpandedNodeId tr_ListOfExpandedNodeId (

-    ExpandedNodeIdArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfStatusCode tr_ListOfStatusCodeNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfStatusCode tr_ListOfStatusCode (

-    StatusCodeArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfDiagnosticInfo tr_ListOfDiagnosticInfoNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfDiagnosticInfo tr_ListOfDiagnosticInfo (

-    DiagnosticInfoArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfQualifiedName tr_ListOfQualifiedNameNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfQualifiedName tr_ListOfQualifiedName (

-    QualifiedNameArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfLocalizedText tr_ListOfLocalizedTextNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfLocalizedText tr_ListOfLocalizedText (

-    LocalizedTextArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfExtensionObject tr_ListOfExtensionObjectNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfExtensionObject tr_ListOfExtensionObject (

-    ExtensionObjectArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfVariant tr_ListOfVariantNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfVariant tr_ListOfVariant (

-    VariantArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfDataValue tr_ListOfDataValueNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfDataValue tr_ListOfDataValue (

-    DataValueArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfDecimal tr_ListOfDecimalNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfDecimal tr_ListOfDecimal (

-    DecimalArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfEnumValueType tr_ListOfEnumValueTypeNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfEnumValueType tr_ListOfEnumValueType (

-    EnumValueTypeArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfEnumField tr_ListOfEnumFieldNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfEnumField tr_ListOfEnumField (

-    EnumFieldArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfExtensibleParameter tr_ListOfExtensibleParameterNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfExtensibleParameter tr_ListOfExtensibleParameter (

-    ExtensibleParameterArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfApplicationDescription tr_ListOfApplicationDescriptionNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfApplicationDescription tr_ListOfApplicationDescription (

-    ApplicationDescriptionArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfBrowseResult tr_ListOfBrowseResultNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfBrowseResult tr_ListOfBrowseResult (

-    BrowseResultArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfContentFilterElement tr_ListOfContentFilterElementNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfContentFilterElement tr_ListOfContentFilterElement (

-    ContentFilterElementArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfContentFilterElementResult tr_ListOfContentFilterElementResultNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfContentFilterElementResult tr_ListOfContentFilterElementResult (

-    ContentFilterElementResultArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfSimpleAttributeOperand tr_ListOfSimpleAttributeOperandNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfSimpleAttributeOperand tr_ListOfSimpleAttributeOperand (

-    SimpleAttributeOperandArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfEndpointDescription tr_ListOfEndpointDescriptionNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfEndpointDescription tr_ListOfEndpointDescription (

-    EndpointDescriptionArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfMonitoringParameters tr_ListOfMonitoringParametersNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfMonitoringParameters tr_ListOfMonitoringParameters (

-    MonitoringParametersArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfGenericAttributeValue tr_ListOfGenericAttributeValueNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfGenericAttributeValue tr_ListOfGenericAttributeValue (

-    GenericAttributeValueArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfMonitoredItemNotification tr_ListOfMonitoredItemNotificationNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfMonitoredItemNotification tr_ListOfMonitoredItemNotification (

-    MonitoredItemNotificationArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfEventFieldList tr_ListOfEventFieldListNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfEventFieldList tr_ListOfEventFieldList (

-    EventFieldListArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfQueryDataSet tr_ListOfQueryDataSetNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfQueryDataSet tr_ListOfQueryDataSet (

-    QueryDataSetArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfReadValueId tr_ListOfReadValueIdNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfReadValueId tr_ListOfReadValueId (

-    ReadValueIdArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfReferenceDescription tr_ListOfReferenceDescriptionNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfReferenceDescription tr_ListOfReferenceDescription (

-    ReferenceDescriptionArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfRelativePathElement tr_ListOfRelativePathElementNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfRelativePathElement tr_ListOfRelativePathElement (

-    RelativePathElementArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfApplicationInstanceCertificate tr_ListOfApplicationInstanceCertificateNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfApplicationInstanceCertificate tr_ListOfApplicationInstanceCertificate (

-    ApplicationInstanceCertificateArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfChannelSecurityToken tr_ListOfChannelSecurityTokenNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfChannelSecurityToken tr_ListOfChannelSecurityToken (

-    ChannelSecurityTokenArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfUserTokenPolicy tr_ListOfUserTokenPolicyNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfUserTokenPolicy tr_ListOfUserTokenPolicy (

-    UserTokenPolicyArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfServerOnNetwork tr_ListOfServerOnNetworkNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfServerOnNetwork tr_ListOfServerOnNetwork (

-    ServerOnNetworkArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfAddNodesItem tr_ListOfAddNodesItemNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfAddNodesItem tr_ListOfAddNodesItem (

-    AddNodesItemArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfAddNodesResult tr_ListOfAddNodesResultNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfAddNodesResult tr_ListOfAddNodesResult (

-    AddNodesResultArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfAddReferencesItem tr_ListOfAddReferencesItemNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfAddReferencesItem tr_ListOfAddReferencesItem (

-    AddReferencesItemArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfDeleteNodesItem tr_ListOfDeleteNodesItemNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfDeleteNodesItem tr_ListOfDeleteNodesItem (

-    DeleteNodesItemArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfDeleteReferencesItem tr_ListOfDeleteReferencesItemNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfDeleteReferencesItem tr_ListOfDeleteReferencesItem (

-    DeleteReferencesItemArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfSignedSoftwareCertificate tr_ListOfSignedSoftwareCertificateNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfSignedSoftwareCertificate tr_ListOfSignedSoftwareCertificate (

-    SignedSoftwareCertificateArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfBrowseDescription tr_ListOfBrowseDescriptionNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfBrowseDescription tr_ListOfBrowseDescription (

-    BrowseDescriptionArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfBrowsePath tr_ListOfBrowsePathNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfBrowsePath tr_ListOfBrowsePath (

-    BrowsePathArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfBrowsePathResult tr_ListOfBrowsePathResultNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfBrowsePathResult tr_ListOfBrowsePathResult (

-    BrowsePathResultArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfBrowsePathTarget tr_ListOfBrowsePathTargetNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfBrowsePathTarget tr_ListOfBrowsePathTarget (

-    BrowsePathTargetArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfNodeTypeDescription tr_ListOfNodeTypeDescriptionNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfNodeTypeDescription tr_ListOfNodeTypeDescription (

-    NodeTypeDescriptionArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfQueryDataDescription tr_ListOfQueryDataDescriptionNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfQueryDataDescription tr_ListOfQueryDataDescription (

-    QueryDataDescriptionArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfParsingResult tr_ListOfParsingResultNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfParsingResult tr_ListOfParsingResult (

-    ParsingResultArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfHistoryReadValueId tr_ListOfHistoryReadValueIdNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfHistoryReadValueId tr_ListOfHistoryReadValueId (

-    HistoryReadValueIdArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfHistoryReadResult tr_ListOfHistoryReadResultNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfHistoryReadResult tr_ListOfHistoryReadResult (

-    HistoryReadResultArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfWriteValue tr_ListOfWriteValueNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfWriteValue tr_ListOfWriteValue (

-    WriteValueArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfHistoryUpdateResult tr_ListOfHistoryUpdateResultNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfHistoryUpdateResult tr_ListOfHistoryUpdateResult (

-    HistoryUpdateResultArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfCallMethodRequest tr_ListOfCallMethodRequestNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfCallMethodRequest tr_ListOfCallMethodRequest (

-    CallMethodRequestArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfCallMethodResult tr_ListOfCallMethodResultNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfCallMethodResult tr_ListOfCallMethodResult (

-    CallMethodResultArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfMonitoredItemCreateRequest tr_ListOfMonitoredItemCreateRequestNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfMonitoredItemCreateRequest tr_ListOfMonitoredItemCreateRequest (

-    MonitoredItemCreateRequestArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfMonitoredItemCreateResult tr_ListOfMonitoredItemCreateResultNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfMonitoredItemCreateResult tr_ListOfMonitoredItemCreateResult (

-    MonitoredItemCreateResultArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfMonitoredItemModifyRequest tr_ListOfMonitoredItemModifyRequestNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfMonitoredItemModifyRequest tr_ListOfMonitoredItemModifyRequest (

-    MonitoredItemModifyRequestArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfMonitoredItemModifyResult tr_ListOfMonitoredItemModifyResultNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfMonitoredItemModifyResult tr_ListOfMonitoredItemModifyResult (

-    MonitoredItemModifyResultArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfSubscriptionAcknowledgement tr_ListOfSubscriptionAcknowledgementNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfSubscriptionAcknowledgement tr_ListOfSubscriptionAcknowledgement (

-    SubscriptionAcknowledgementArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-  template ListOfTransferResult tr_ListOfTransferResultNull := {

-    nullArray := tr_NullArray

-  }

-

-  template ListOfTransferResult tr_ListOfTransferResult (

-    TransferResultArray values

-  ) := {

-    realArray := {

-      arrayLength := lengthof(values),

-      arrayValues := values

-    }

-  }

-

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                    Message Headers                      //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  template MessageHeader tr_HeaderHello := {

-    messageType := HelloHeaderMsgType,

-    chunkType := FinalChunk,

-    messageSize  := 0

-  }

-

-  template MessageHeader tr_HeaderAck := {

-    messageType := AckHeaderMsgType,

-    chunkType := FinalChunk,

-    messageSize  := 0

-  }

-

-  template MessageHeader tr_HeaderError := {

-    messageType := ErrorHeaderMsgType,

-    chunkType := FinalChunk,

-    messageSize  := 0

-  }

-

-  template MessageHeader tr_HeaderReverseHello := {

-    messageType := ReverseHelloHeaderMsgType,

-    chunkType := FinalChunk,

-    messageSize  := 0

-  }

-

-  template MessageHeader tr_HeaderOpenSecureChannel := {

-    messageType := OpenSecureChannelMsgType,

-    chunkType := FinalChunk,

-    messageSize  := 0

-  }

-

-  template MessageHeader tr_HeaderCloseSecureChannel := {

-    messageType := CloseSecureChannelMsgType,

-    chunkType := FinalChunk,

-    messageSize  := 0

-  }

-

-  template MessageHeader tr_HeaderService := {

-    messageType := ServicesMsgType,

-    chunkType := FinalChunk,

-    messageSize  := 0

-  }

-

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                       Messages                          //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  template MessageChunk tr_UndefinedMessage := {

-    header := ?,

-    transportMessage := ?,

-    securityChannelId := omit,

-    securePolicyUri := omit,

-    senderCertificate := omit,

-    receiverCertificateThumbprint := omit,

-    securityTokenId := omit,

-    sequenceHeader := omit,

-    body := omit

-  }

-

-  template MessageChunk tr_MessageHello (

-    MessageHeader header,

-    HelloMessage body

-  ) modifies tr_UndefinedMessage := {

-    header := header,

-    transportMessage := {

-      helloMessage := body

-    }

-  }

-

-  template MessageChunk tr_MessageAck (

-    MessageHeader header,

-    AckMessage body

-  ) modifies tr_UndefinedMessage := {

-    header := header,

-    transportMessage := {

-      ackMessage := body

-    }

-  }

-

-  template MessageChunk tr_MessageReverseHello (

-    MessageHeader header,

-    ReverseHelloMessage body

-  ) modifies tr_UndefinedMessage := {

-    header := header,

-    transportMessage := {

-      reverseHelloMessage := body

-    }

-  }

-

-  template MessageChunk tr_MessageError (

-    MessageHeader header,

-    ErrorMessage body

-  ) modifies tr_UndefinedMessage := {

-    header := header,

-    transportMessage := {

-      errorMessage := body

-    }

-  }

-

-  template MessageChunk tr_MessageOpenSecureChannel (

-    MessageHeader header,

-    UInt32 securityChannelId,

-    ListOfByte securePolicyUri,

-    ListOfByte senderCertificate,

-    ListOfByte receiverCertificateThumbprint,

-    SequenceHeader sequenceHeader,

-    octetstring body

-  ) modifies tr_UndefinedMessage := {

-    header := header,

-    transportMessage := omit,

-    securityChannelId := securityChannelId,

-    securePolicyUri := securePolicyUri,

-    senderCertificate := senderCertificate,

-    receiverCertificateThumbprint := receiverCertificateThumbprint,

-    sequenceHeader := sequenceHeader,

-    body := body

-  }

-

-  template MessageChunk tr_MessageCloseSecureChannel (

-    MessageHeader header,

-    UInt32 securityChannelId,

-    UInt32 securityTokenId,

-    SequenceHeader sequenceHeader,

-    octetstring body

-  ) modifies tr_UndefinedMessage := {

-    header := header,

-    transportMessage := omit,

-    securityChannelId := securityChannelId,

-    securityTokenId := securityTokenId,

-    sequenceHeader := sequenceHeader,

-    body := body

-  }

-

-  template MessageChunk tr_MessageService (

-    MessageHeader header,

-    UInt32 securityChannelId,

-    UInt32 securityTokenId,

-    SequenceHeader sequenceHeader,

-    octetstring body

-  ) modifies tr_UndefinedMessage := {

-    header := header,

-    transportMessage := omit,

-    securityChannelId := securityChannelId,

-    securityTokenId := securityTokenId,

-    sequenceHeader := sequenceHeader,

-    body := body

-  }

-

-  template ServiceBody tr_ServiceBody (

-    Byte namespaceIndex,

-    UInt16 nodeValue,

-    ServiceList service

-  ) := {

-    encodingByte := 1,

-    namespaceIndex := namespaceIndex,

-    nodeValue := 0, //Encoder will assign it

-    list := service

-  }

-

+/////////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2017-2018  Ericsson AB
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+/////////////////////////////////////////////////////////////////////////////////////
+// Contributors:
+// Akos Makovics
+//
+//  File:         UpcUa_Templates_Binary.ttcn
+//  Rev:          <RnXnn>
+//  Prodnr:       CNL113861
+/////////////////////////////////////////////////////////////////////////////////////
+
+
+module OpcUa_Templates_Binary {
+
+  import from OpcUa_Types_Binary all;
+
+  /////////////////////////////////////////////////////////////
+  //                      Templates                          //
+  //      Note: Not every type has a template, and           //
+  //       some types may have multiple templates.           //
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                   Complex Types                         //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  //String with a value
+  template String tr_String (
+    charstring stringValue
+  ):= {
+    realString := {
+      stringLength := 0,
+      stringValue := stringValue
+    }
+  }
+
+  //Null String
+  template String tr_StringNull := {
+    nullString := {
+      arrayLength := Null_Value
+    }
+  }
+
+  //ByteString with a value
+  template ByteString tr_ByteString (
+    ByteArray arrayValue
+  ):= {
+    realByteString := {
+      lengthValue := 0,
+      byteStringValue := arrayValue
+    }
+  }
+
+  //Null ByteString
+  template ByteString tr_ByteStringNull := {
+    nullByteString := {
+      arrayLength := Null_Value
+    }
+  }
+
+  //A two byte Node ID
+  template NodeId tr_NodeIdTwoByte (
+    Byte nodeValue
+  ) := {
+    mask := 0,
+    namespaceUriBit := 0,
+    serverIndexBit := 0,
+    reservedBit1 := 0,
+    reservedBit2 := 0,
+    IdType := {
+      twoByte := {
+        nodeValue := nodeValue
+      }
+    }
+  }
+
+  //A four byte Node ID
+  template NodeId tr_NodeIdFourByte (
+    Byte nameSpace,
+    UInt16 nodeValue
+  ) := {
+    mask := 1,
+    namespaceUriBit := 0,
+    serverIndexBit := 0,
+    reservedBit1 := 0,
+    reservedBit2 := 0,
+    IdType := {
+      fourByte := {
+        nameSpace := nameSpace,
+        nodeValue := nodeValue
+      }
+    }
+  }
+
+  //A numeric Node ID
+  template NodeId tr_NodeIdNumeric (
+    Byte nameSpace,
+    UInt32 nodeValue
+  ) := {
+    mask := 2,
+    namespaceUriBit := 0,
+    serverIndexBit := 0,
+    reservedBit1 := 0,
+    reservedBit2 := 0,
+    IdType := {
+      fourByte := {
+        nameSpace := nameSpace,
+        nodeValue := nodeValue
+      }
+    }
+  }
+
+  //A string Node ID
+  template NodeId tr_NodeIdString (
+    UInt16 nameSpace,
+    String nodeValue
+  ) := {
+    mask := 3,
+    namespaceUriBit := 0,
+    serverIndexBit := 0,
+    reservedBit1 := 0,
+    reservedBit2 := 0,
+    IdType := {
+      string := {
+        nameSpace := nameSpace,
+        nodeValue := nodeValue
+      }
+    }
+  }
+
+  //A guid Node ID
+  template NodeId tr_NodeIdGuid (
+    UInt16 nameSpace,
+    Guid nodeValue
+  ) := {
+    mask := 4,
+    namespaceUriBit := 0,
+    serverIndexBit := 0,
+    reservedBit1 := 0,
+    reservedBit2 := 0,
+    IdType := {
+      guid := {
+        nameSpace := nameSpace,
+        nodeValue := nodeValue
+      }
+    }
+  }
+
+  //A ByteString Node ID
+  template NodeId tr_NodeIdByteString (
+    UInt16 nameSpace,
+    ByteString nodeValue
+  ) := {
+    mask := 5,
+    namespaceUriBit := 0,
+    serverIndexBit := 0,
+    reservedBit1 := 0,
+    reservedBit2 := 0,
+    IdType := {
+      byteString := {
+        nameSpace := nameSpace,
+        nodeValue := nodeValue
+      }
+    }
+  }
+
+  //A variant type with a single value
+  template Variant tr_Variant (
+    VariantSingleValue ValueSingle
+  ) := {
+    encodingBits := 0, //Encoder will assign proper value
+    arrayDimensionsBit := 0,
+    arrayEncodedBit := 0,
+    arrayLength := omit,
+    ValueSingle := ValueSingle,
+    ValueArray := omit,
+    arrayDimensionsLenght := omit,
+    arrayDimensions := omit
+  }
+
+  //A variant type with an array value
+  template Variant tr_VariantArray (
+    integer arrayLength,
+    VariantArrayValue ValueArray
+  ) := {
+    encodingBits := 0, //Encoder will assign proper value
+    arrayDimensionsBit := 0,
+    arrayEncodedBit := 1,
+    arrayLength := arrayLength,
+    ValueSingle := omit,
+    ValueArray := ValueArray,
+    arrayDimensionsLenght := omit,
+    arrayDimensions := omit
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Lists and Arrays                        //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  template NullArray tr_NullArray := {
+    arrayLength := Null_Value
+  }
+
+  template ListOfBoolean tr_ListOfBooleanNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfBoolean tr_ListOfBoolean (
+    BooleanArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfSByte tr_ListOfSByteNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfSByte tr_ListOfSByte (
+    SByteArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfByte tr_ListOfByteNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfByte tr_ListOfByte (
+    ByteArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfInt16 tr_ListOfInt16Null := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfInt16 tr_ListOfInt16 (
+    Int16Array values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfUInt16 tr_ListOfUInt16Null := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfUInt16 tr_ListOfUInt16 (
+    UInt16Array values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfInt32 tr_ListOfInt32Null := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfInt32 tr_ListOfInt32 (
+    Int32Array values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfUInt32 tr_ListOfUInt32Null := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfUInt32 tr_ListOfUInt32 (
+    UInt32Array values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfInt64 tr_ListOfInt64Null := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfInt64 tr_ListOfInt64 (
+    Int64Array values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfUInt64 tr_ListOfUInt64Null := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfUInt64 tr_ListOfUInt64 (
+    UInt64Array values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfFloat tr_ListOfFloatNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfFloat tr_ListOfFloat (
+    FloatArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfDouble tr_ListOfDoubleNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfDouble tr_ListOfDouble (
+    DoubleArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfDateTime tr_ListOfDateTimeNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfDateTime tr_ListOfDateTime (
+    DateTimeArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfUtcTime tr_ListOfUtcTimeNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfUtcTime tr_ListOfUtcTime (
+    UtcTimeArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfCounter tr_ListOfCounterNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfCounter tr_ListOfCounter (
+    CounterArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfIntegerId tr_ListOfIntegerIdNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfIntegerId tr_ListOfIntegerId (
+    IntegerIdArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfLocaleId tr_ListOfLocaleIdNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfLocaleId tr_ListOfLocaleId (
+    LocaleIdArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfContinuationPoint tr_ListOfContinuationPointNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfContinuationPoint tr_ListOfContinuationPoint (
+    ContinuationPointArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfString tr_ListOfStringNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfString tr_ListOfString (
+    StringArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfGuid tr_ListOfGuidNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfGuid tr_ListOfGuid (
+    GuidArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfByteString tr_ListOfByteStringNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfByteString tr_ListOfByteString (
+    ByteStringArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfXmlElement tr_ListOfXmlElementNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfXmlElement tr_ListOfXmlElement (
+    XmlElementArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfNodeId tr_ListOfNodeIdNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfNodeId tr_ListOfNodeId (
+    NodeIdArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfExpandedNodeId tr_ListOfExpandedNodeIdNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfExpandedNodeId tr_ListOfExpandedNodeId (
+    ExpandedNodeIdArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfStatusCode tr_ListOfStatusCodeNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfStatusCode tr_ListOfStatusCode (
+    StatusCodeArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfDiagnosticInfo tr_ListOfDiagnosticInfoNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfDiagnosticInfo tr_ListOfDiagnosticInfo (
+    DiagnosticInfoArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfQualifiedName tr_ListOfQualifiedNameNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfQualifiedName tr_ListOfQualifiedName (
+    QualifiedNameArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfLocalizedText tr_ListOfLocalizedTextNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfLocalizedText tr_ListOfLocalizedText (
+    LocalizedTextArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfExtensionObject tr_ListOfExtensionObjectNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfExtensionObject tr_ListOfExtensionObject (
+    ExtensionObjectArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfVariant tr_ListOfVariantNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfVariant tr_ListOfVariant (
+    VariantArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfDataValue tr_ListOfDataValueNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfDataValue tr_ListOfDataValue (
+    DataValueArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfDecimal tr_ListOfDecimalNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfDecimal tr_ListOfDecimal (
+    DecimalArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfEnumValueType tr_ListOfEnumValueTypeNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfEnumValueType tr_ListOfEnumValueType (
+    EnumValueTypeArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfEnumField tr_ListOfEnumFieldNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfEnumField tr_ListOfEnumField (
+    EnumFieldArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfExtensibleParameter tr_ListOfExtensibleParameterNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfExtensibleParameter tr_ListOfExtensibleParameter (
+    ExtensibleParameterArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfApplicationDescription tr_ListOfApplicationDescriptionNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfApplicationDescription tr_ListOfApplicationDescription (
+    ApplicationDescriptionArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfBrowseResult tr_ListOfBrowseResultNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfBrowseResult tr_ListOfBrowseResult (
+    BrowseResultArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfContentFilterElement tr_ListOfContentFilterElementNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfContentFilterElement tr_ListOfContentFilterElement (
+    ContentFilterElementArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfContentFilterElementResult tr_ListOfContentFilterElementResultNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfContentFilterElementResult tr_ListOfContentFilterElementResult (
+    ContentFilterElementResultArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfSimpleAttributeOperand tr_ListOfSimpleAttributeOperandNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfSimpleAttributeOperand tr_ListOfSimpleAttributeOperand (
+    SimpleAttributeOperandArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfEndpointDescription tr_ListOfEndpointDescriptionNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfEndpointDescription tr_ListOfEndpointDescription (
+    EndpointDescriptionArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfMonitoringParameters tr_ListOfMonitoringParametersNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfMonitoringParameters tr_ListOfMonitoringParameters (
+    MonitoringParametersArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfGenericAttributeValue tr_ListOfGenericAttributeValueNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfGenericAttributeValue tr_ListOfGenericAttributeValue (
+    GenericAttributeValueArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfMonitoredItemNotification tr_ListOfMonitoredItemNotificationNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfMonitoredItemNotification tr_ListOfMonitoredItemNotification (
+    MonitoredItemNotificationArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfEventFieldList tr_ListOfEventFieldListNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfEventFieldList tr_ListOfEventFieldList (
+    EventFieldListArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfQueryDataSet tr_ListOfQueryDataSetNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfQueryDataSet tr_ListOfQueryDataSet (
+    QueryDataSetArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfReadValueId tr_ListOfReadValueIdNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfReadValueId tr_ListOfReadValueId (
+    ReadValueIdArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfReferenceDescription tr_ListOfReferenceDescriptionNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfReferenceDescription tr_ListOfReferenceDescription (
+    ReferenceDescriptionArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfRelativePathElement tr_ListOfRelativePathElementNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfRelativePathElement tr_ListOfRelativePathElement (
+    RelativePathElementArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfApplicationInstanceCertificate tr_ListOfApplicationInstanceCertificateNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfApplicationInstanceCertificate tr_ListOfApplicationInstanceCertificate (
+    ApplicationInstanceCertificateArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfChannelSecurityToken tr_ListOfChannelSecurityTokenNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfChannelSecurityToken tr_ListOfChannelSecurityToken (
+    ChannelSecurityTokenArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfUserTokenPolicy tr_ListOfUserTokenPolicyNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfUserTokenPolicy tr_ListOfUserTokenPolicy (
+    UserTokenPolicyArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfServerOnNetwork tr_ListOfServerOnNetworkNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfServerOnNetwork tr_ListOfServerOnNetwork (
+    ServerOnNetworkArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfAddNodesItem tr_ListOfAddNodesItemNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfAddNodesItem tr_ListOfAddNodesItem (
+    AddNodesItemArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfAddNodesResult tr_ListOfAddNodesResultNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfAddNodesResult tr_ListOfAddNodesResult (
+    AddNodesResultArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfAddReferencesItem tr_ListOfAddReferencesItemNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfAddReferencesItem tr_ListOfAddReferencesItem (
+    AddReferencesItemArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfDeleteNodesItem tr_ListOfDeleteNodesItemNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfDeleteNodesItem tr_ListOfDeleteNodesItem (
+    DeleteNodesItemArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfDeleteReferencesItem tr_ListOfDeleteReferencesItemNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfDeleteReferencesItem tr_ListOfDeleteReferencesItem (
+    DeleteReferencesItemArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfSignedSoftwareCertificate tr_ListOfSignedSoftwareCertificateNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfSignedSoftwareCertificate tr_ListOfSignedSoftwareCertificate (
+    SignedSoftwareCertificateArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfBrowseDescription tr_ListOfBrowseDescriptionNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfBrowseDescription tr_ListOfBrowseDescription (
+    BrowseDescriptionArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfBrowsePath tr_ListOfBrowsePathNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfBrowsePath tr_ListOfBrowsePath (
+    BrowsePathArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfBrowsePathResult tr_ListOfBrowsePathResultNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfBrowsePathResult tr_ListOfBrowsePathResult (
+    BrowsePathResultArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfBrowsePathTarget tr_ListOfBrowsePathTargetNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfBrowsePathTarget tr_ListOfBrowsePathTarget (
+    BrowsePathTargetArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfNodeTypeDescription tr_ListOfNodeTypeDescriptionNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfNodeTypeDescription tr_ListOfNodeTypeDescription (
+    NodeTypeDescriptionArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfQueryDataDescription tr_ListOfQueryDataDescriptionNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfQueryDataDescription tr_ListOfQueryDataDescription (
+    QueryDataDescriptionArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfParsingResult tr_ListOfParsingResultNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfParsingResult tr_ListOfParsingResult (
+    ParsingResultArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfHistoryReadValueId tr_ListOfHistoryReadValueIdNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfHistoryReadValueId tr_ListOfHistoryReadValueId (
+    HistoryReadValueIdArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfHistoryReadResult tr_ListOfHistoryReadResultNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfHistoryReadResult tr_ListOfHistoryReadResult (
+    HistoryReadResultArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfWriteValue tr_ListOfWriteValueNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfWriteValue tr_ListOfWriteValue (
+    WriteValueArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfHistoryUpdateResult tr_ListOfHistoryUpdateResultNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfHistoryUpdateResult tr_ListOfHistoryUpdateResult (
+    HistoryUpdateResultArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfCallMethodRequest tr_ListOfCallMethodRequestNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfCallMethodRequest tr_ListOfCallMethodRequest (
+    CallMethodRequestArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfCallMethodResult tr_ListOfCallMethodResultNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfCallMethodResult tr_ListOfCallMethodResult (
+    CallMethodResultArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfMonitoredItemCreateRequest tr_ListOfMonitoredItemCreateRequestNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfMonitoredItemCreateRequest tr_ListOfMonitoredItemCreateRequest (
+    MonitoredItemCreateRequestArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfMonitoredItemCreateResult tr_ListOfMonitoredItemCreateResultNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfMonitoredItemCreateResult tr_ListOfMonitoredItemCreateResult (
+    MonitoredItemCreateResultArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfMonitoredItemModifyRequest tr_ListOfMonitoredItemModifyRequestNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfMonitoredItemModifyRequest tr_ListOfMonitoredItemModifyRequest (
+    MonitoredItemModifyRequestArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfMonitoredItemModifyResult tr_ListOfMonitoredItemModifyResultNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfMonitoredItemModifyResult tr_ListOfMonitoredItemModifyResult (
+    MonitoredItemModifyResultArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfSubscriptionAcknowledgement tr_ListOfSubscriptionAcknowledgementNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfSubscriptionAcknowledgement tr_ListOfSubscriptionAcknowledgement (
+    SubscriptionAcknowledgementArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+  template ListOfTransferResult tr_ListOfTransferResultNull := {
+    nullArray := tr_NullArray
+  }
+
+  template ListOfTransferResult tr_ListOfTransferResult (
+    TransferResultArray values
+  ) := {
+    realArray := {
+      arrayLength := lengthof(values),
+      arrayValues := values
+    }
+  }
+
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                    Message Headers                      //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  template MessageHeader tr_HeaderHello := {
+    messageType := HelloHeaderMsgType,
+    chunkType := FinalChunk,
+    messageSize  := 0
+  }
+
+  template MessageHeader tr_HeaderAck := {
+    messageType := AckHeaderMsgType,
+    chunkType := FinalChunk,
+    messageSize  := 0
+  }
+
+  template MessageHeader tr_HeaderError := {
+    messageType := ErrorHeaderMsgType,
+    chunkType := FinalChunk,
+    messageSize  := 0
+  }
+
+  template MessageHeader tr_HeaderReverseHello := {
+    messageType := ReverseHelloHeaderMsgType,
+    chunkType := FinalChunk,
+    messageSize  := 0
+  }
+
+  template MessageHeader tr_HeaderOpenSecureChannel := {
+    messageType := OpenSecureChannelMsgType,
+    chunkType := FinalChunk,
+    messageSize  := 0
+  }
+
+  template MessageHeader tr_HeaderCloseSecureChannel := {
+    messageType := CloseSecureChannelMsgType,
+    chunkType := FinalChunk,
+    messageSize  := 0
+  }
+
+  template MessageHeader tr_HeaderService := {
+    messageType := ServicesMsgType,
+    chunkType := FinalChunk,
+    messageSize  := 0
+  }
+
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                       Messages                          //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  template MessageChunk tr_UndefinedMessage := {
+    header := ?,
+    transportMessage := ?,
+    securityChannelId := omit,
+    securePolicyUri := omit,
+    senderCertificate := omit,
+    receiverCertificateThumbprint := omit,
+    securityTokenId := omit,
+    sequenceHeader := omit,
+    body := omit
+  }
+
+  template MessageChunk tr_MessageHello (
+    MessageHeader header,
+    HelloMessage body
+  ) modifies tr_UndefinedMessage := {
+    header := header,
+    transportMessage := {
+      helloMessage := body
+    }
+  }
+
+  template MessageChunk tr_MessageAck (
+    MessageHeader header,
+    AckMessage body
+  ) modifies tr_UndefinedMessage := {
+    header := header,
+    transportMessage := {
+      ackMessage := body
+    }
+  }
+
+  template MessageChunk tr_MessageReverseHello (
+    MessageHeader header,
+    ReverseHelloMessage body
+  ) modifies tr_UndefinedMessage := {
+    header := header,
+    transportMessage := {
+      reverseHelloMessage := body
+    }
+  }
+
+  template MessageChunk tr_MessageError (
+    MessageHeader header,
+    ErrorMessage body
+  ) modifies tr_UndefinedMessage := {
+    header := header,
+    transportMessage := {
+      errorMessage := body
+    }
+  }
+
+  template MessageChunk tr_MessageOpenSecureChannel (
+    MessageHeader header,
+    UInt32 securityChannelId,
+    ListOfByte securePolicyUri,
+    ListOfByte senderCertificate,
+    ListOfByte receiverCertificateThumbprint,
+    SequenceHeader sequenceHeader,
+    octetstring body
+  ) modifies tr_UndefinedMessage := {
+    header := header,
+    transportMessage := omit,
+    securityChannelId := securityChannelId,
+    securePolicyUri := securePolicyUri,
+    senderCertificate := senderCertificate,
+    receiverCertificateThumbprint := receiverCertificateThumbprint,
+    sequenceHeader := sequenceHeader,
+    body := body
+  }
+
+  template MessageChunk tr_MessageCloseSecureChannel (
+    MessageHeader header,
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+    octetstring body
+  ) modifies tr_UndefinedMessage := {
+    header := header,
+    transportMessage := omit,
+    securityChannelId := securityChannelId,
+    securityTokenId := securityTokenId,
+    sequenceHeader := sequenceHeader,
+    body := body
+  }
+
+  template MessageChunk tr_MessageService (
+    MessageHeader header,
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+    octetstring body
+  ) modifies tr_UndefinedMessage := {
+    header := header,
+    transportMessage := omit,
+    securityChannelId := securityChannelId,
+    securityTokenId := securityTokenId,
+    sequenceHeader := sequenceHeader,
+    body := body
+  }
+
+  template ServiceBody tr_ServiceBody (
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+    ServiceList service
+  ) := {
+    encodingByte := 1,
+    namespaceIndex := namespaceIndex,
+    nodeValue := 0, //Encoder will assign it
+    list := service
+  }
+
 }
\ No newline at end of file
diff --git a/src/OpcUa_Templates_JSON_Non_Reversible.ttcn b/src/OpcUa_Templates_JSON_Non_Reversible.ttcn
new file mode 100644
index 0000000..f1dba4f
--- /dev/null
+++ b/src/OpcUa_Templates_JSON_Non_Reversible.ttcn
@@ -0,0 +1,136 @@
+/////////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2017-2018  Ericsson AB
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+/////////////////////////////////////////////////////////////////////////////////////
+// Contributors:
+// Akos Makovics
+//
+//  File:         OpcUa_Templates_JSON_Reversible.ttcn
+//  Rev:          <RnXnn>
+//  Prodnr:       CNL113861
+/////////////////////////////////////////////////////////////////////////////////////
+
+module OpcUa_Templates_JSON_Non_Reversible {
+
+  import from OpcUa_Types_JSON_Non_Reversible all;
+
+  /////////////////////////////////////////////////////////////
+  //                      Templates                          //
+  //      Note: Not every type has a template, and           //
+  //       some types may have multiple templates.           //
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                   Complex Types                         //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  template NodeIdNamsespace tr_Namespace (
+    String namespace
+  ) := {
+    StringNamespace := namespace
+  }
+
+  template NodeIdNamsespace tr_Namespace_1 := {
+    IntNamespace := 1
+  }
+
+  //NodeId with an UInt32 value
+  template NodeId tr_NodeId_UInt32 (
+    UInt32 Id,
+    template NodeIdNamsespace Namespace
+  ):= {
+    IdType := omit,
+    Id := {
+      UInt32NodeId := Id
+    },
+    Namespace := Namespace
+  }
+   //NodeId with a String value
+  template NodeId tr_NodeId_String (
+    String Id,
+    template NodeIdNamsespace Namespace
+  ):= {
+    IdType := 1,
+    Id := {
+      StringNodeId := Id
+    },
+    Namespace := Namespace
+  }
+   //NodeId with a GUID value
+  template NodeId tr_NodeId_GUID (
+    Guid Id,
+    template NodeIdNamsespace Namespace
+  ):= {
+    IdType := 2,
+    Id := {
+      GuidNodeId := Id
+    },
+    Namespace := Namespace
+  }
+   //NodeId with a ByteString value
+  template NodeId tr_NodeId_ByteString (
+    ByteString Id,
+    template NodeIdNamsespace Namespace
+  ):= {
+    IdType := 3,
+    Id := {
+      ByteStringNodeId := Id
+    },
+    Namespace := Namespace
+  }
+   //ExpandedNodeId with an UInt32 value
+  template ExpandedNodeId tr_ExpandedNodeId_UInt32 (
+    UInt32 Id,
+    template NodeIdNamsespace Namespace,
+    template String ServerURI
+  ):= {
+    IdType := omit,
+    Id := {
+      UInt32NodeId := Id
+    },
+    Namespace := Namespace,
+    ServerURI := ServerURI
+  }
+   //ExpandedNodeId with a String value
+  template ExpandedNodeId tr_ExpandedNodeId_String (
+    String Id,
+    template NodeIdNamsespace Namespace,
+    template String ServerURI
+  ):= {
+    IdType := 1,
+    Id := {
+      StringNodeId := Id
+    },
+    Namespace := Namespace,
+    ServerURI := ServerURI
+  }
+   //ExpandedNodeId with a GUID value
+  template ExpandedNodeId tr_ExpandedNodeId_GUID (
+    Guid Id,
+    template NodeIdNamsespace Namespace,
+    template String ServerURI
+  ):= {
+    IdType := 2,
+    Id := {
+      GuidNodeId := Id
+    },
+    Namespace := Namespace,
+    ServerURI := ServerURI
+  }
+   //ExpandedNodeId with a ByteString value
+  template ExpandedNodeId tr_ExpandedNodeId_ByteString (
+    ByteString Id,
+    template NodeIdNamsespace Namespace,
+    template String ServerURI
+  ):= {
+    IdType := 3,
+    Id := {
+      ByteStringNodeId := Id
+    },
+    Namespace := Namespace,
+    ServerURI := ServerURI
+  }
+}
diff --git a/src/OpcUa_Templates_JSON_Reversible.ttcn b/src/OpcUa_Templates_JSON_Reversible.ttcn
index 8782a59..804d559 100644
--- a/src/OpcUa_Templates_JSON_Reversible.ttcn
+++ b/src/OpcUa_Templates_JSON_Reversible.ttcn
@@ -27,7 +27,7 @@
   //                   Complex Types                         //
   //                                                         //
   /////////////////////////////////////////////////////////////
-   //TODO: Add Templates
+
    //NodeId with an UInt32 value
   template NodeId tr_NodeId_UInt32 (
     UInt32 Id,
diff --git a/src/OpcUa_Types_Binary.ttcn b/src/OpcUa_Types_Binary.ttcn
old mode 100644
new mode 100755
index b3eda0a..5355f08
--- a/src/OpcUa_Types_Binary.ttcn
+++ b/src/OpcUa_Types_Binary.ttcn
@@ -1,3756 +1,3756 @@
-/////////////////////////////////////////////////////////////////////////////////////

-// Copyright (c) 2017-2018  Ericsson AB

-// All rights reserved. This program and the accompanying materials

-// are made available under the terms of the Eclipse Public License v1.0

-// which accompanies this distribution, and is available at

-// http://www.eclipse.org/legal/epl-v10.html

-/////////////////////////////////////////////////////////////////////////////////////

-// Contributors:

-// Akos Makovics

-//

-//  File:         UpcUa_Types_Binary.ttcn

-//  Rev:          <RnXnn>

-//  Prodnr:       CNL113861

-/////////////////////////////////////////////////////////////////////////////////////

-

-module OpcUa_Types_Binary

-{

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                 Encoders and Decoders                   //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  external function enc_MessageChunk (in MessageChunk msg) return octetstring

-    with { extension "prototype(convert) encode(RAW)" }

-

-  external function dec_MessageChunk (in octetstring p_oct, out MessageChunk msg) return integer

-    with {extension "prototype(backtrack) decode (RAW) errorbehavior(ALL:WARNING)"}

-

-  external function enc_ServiceBody (in ServiceBody msg) return octetstring

-    with { extension "prototype(convert) encode(RAW)" }

-

-  external function dec_ServiceBody (in octetstring p_oct, out ServiceBody msg) return integer

-    with {extension "prototype(backtrack) decode (RAW) errorbehavior(ALL:WARNING)"}

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                     Constant Values                     //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  const integer Null_Value := -2147483647;

-

-  const integer HelloHeaderMsgType := 4998472;

-  const integer AckHeaderMsgType := 4932417;

-  const integer ErrorHeaderMsgType := 5395013;

-  const integer ReverseHelloHeaderMsgType := 4540498;

-

-  const integer OpenSecureChannelMsgType := 5132367;

-  const integer CloseSecureChannelMsgType := 5196867;

-  const integer ServicesMsgType := 4674381;

-

-  const integer FinalChunk := 70;

-  const integer IntermediateChunk := 67;

-  const integer ErrorChunk := 65;

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                     Enumerations                        //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type enumerated MessageSecurityMode {

-    INVALID_0,

-    NONE_1,

-    SIGN_2,

-    SIGNANDENCRYPT_3

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated SecurityTokenRequestType {

-    ISSUE_0,

-    RENEW_1

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated NodeClass

-  {

-    UNSPECIFIED_0(0),

-    OBJECT_1(1),

-    VARIABLE_2(2),

-    METHOD_4(4),

-    OBJECT_TYPE_8(8),

-    VARIABLE_TYPE_16(16),

-    REFERENCE_TYPE_32(32),

-    DATA_TYPE_64(64),

-    VIEW_128(128)

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated StructureType {

-    STRUCTURE_0,

-    STRUCTURE_WITH_OPTIONAL_FIELDS_1,

-    UNION_2

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated ApplicationType {

-    SERVER_0,

-    CLIENT_1,

-    CLIENTANDSERVER_2,

-    DISCOVERYSERVER_3

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated DataChangeTrigger {

-    STATUS_0,

-    STATUS_VALUE_1,

-    STATUS_VALUE_TIMESTAMP_2

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated MonitoringMode {

-    DISABLED_0,

-    SAMPLING_1,

-    REPORTING_2

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated BrowseDirection {

-    FORWARD_0,

-    INVERSE_1,

-    BOTH_2

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated TimestampsToReturn {

-    SOURCE_0,

-    SERVER_1,

-    BOTH_2,

-    NEITHER_3

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated UserIdentityTokenType {

-    ANONYMOUS_0,

-    USERNAME_1,

-    CERTIFICATE_2,

-    ISSUEDTOKEN_3

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated PerformUpdateType {

-    INSERT_1(1),

-    REPLACE_2(2),

-    UPDATE_3(3)

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated PerformUpdateTypeExtended {

-    INSERT_1(1),

-    REPLACE_2(2),

-    UPDATE_3(3),

-    REMOVE_4(4)

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated IdType

-  {

-    NUMERIC_0,

-    STRING_1,

-    GUID_2,

-    OPAQUE_3

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated FilterOperator {

-    Equals_0,

-    IsNull_1,

-    GreaterThan_2,

-    LessThan_3,

-    GreaterThanOrEqual_4,

-    LessThanOrEqual_5,

-    Like_6,

-    Not_7,

-    Between_8,

-    InList_9,

-    And_10,

-    Or_11,

-    Cast_12,

-    InView_13,

-    OfType_14,

-    RelatedTo_15,

-    BitwiseAnd_16,

-    BitwiseOr_17

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated OpenFileMode

-  {

-    READ_1(1),

-    WRITE_2(2),

-    ERASE_EXISTING_4(4),

-    APPEND_8(8)

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  type enumerated TrustListMasks

-  {

-    none_0(0),

-    trustedCertificates_1(1),

-    trustedCrls_2(2),

-    issuerCertificates_4(4),

-    issuerCrls_8(8),

-    all_15(15)

-  } with {

-    variant "FIELDLENGTH(32)"

-    variant "COMP(signbit)"

-    variant "BYTEORDER(first)"

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                      Base Types                         //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  //Value 0 is false, any other value is true. Encoder must use value 1 as true

-  type Byte Boolean;

-

-  //An integer value between 0 and 1

-  type integer Bit with { variant "FIELDLENGTH(1), COMP(nosign), BYTEORDER(first)" };

-

-  //An integer value between 0 and 15

-  type integer Bit4 with { variant "FIELDLENGTH(4), COMP(nosign), BYTEORDER(first)" };

-

-  //An integer value between 0 and 63

-  type integer Bit6 with { variant "FIELDLENGTH(6), COMP(nosign), BYTEORDER(first)" };

-

-  //An integer value between -128 and 127 inclusive.

-  type integer SByte with { variant "FIELDLENGTH(8), COMP(signbit), BYTEORDER(first)" };

-

-  //An integer value between 0 and 255 inclusive.

-  type integer Byte with { variant "FIELDLENGTH(8), COMP(nosign), BYTEORDER(first)" };

-

-  //An integer value between -32 768 and 32 767 inclusive.

-  type integer Int16 with { variant "FIELDLENGTH(16), COMP(signbit), BYTEORDER(first)" };

-

-  //An integer value between 0 and 65 535 inclusive.

-  type integer UInt16 with { variant "FIELDLENGTH(16), COMP(nosign), BYTEORDER(first)" };

-

-  //An integer value between 0 and 16 777 215

-  type integer UInt24 with { variant "FIELDLENGTH(24), COMP(nosign), BYTEORDER(first)" }

-

-  //An integer value between -2 147 483 648 and 2 147 483 647 inclusive.

-  type integer Int32 with { variant "FIELDLENGTH(32), COMP(signbit), BYTEORDER(first)" };

-

-  //An integer value between 0 and 4 294 967 295 inclusive.

-  type integer UInt32 with { variant "FIELDLENGTH(32), COMP(nosign), BYTEORDER(first)" };

-

-  //An integer value between -9 223 372 036 854 775 808 and 9 223 372 036 854 775 807 inclusive.

-  type integer Int64 with { variant "FIELDLENGTH(64), COMP(signbit), BYTEORDER(first)" };

-

-  //An integer value between 0 and 18 446 744 073 709 551 615 inclusive.

-  type integer UInt64 with { variant "FIELDLENGTH(64), COMP(nosign), BYTEORDER(first)" };

-

-  //An IEEE single precision (32 bit) floating point value.

-  type float Float with { variant "FORMAT(IEEE754 float), FIELDLENGTH(32), BYTEORDER(last)"};

-

-  //An IEEE double precision (64 bit) floating point value.

-  type float Double with { variant "FORMAT(IEEE754 double), FIELDLENGTH(64), BYTEORDER(last)"};

-

-  //Defines an interval of time in milliseconds

-  type float Duration with { variant "FORMAT(IEEE754 double), BYTEORDER(last)"};

-

-  //Number of 100 nanosecond intervals since January 1, 1601

-  type integer DateTime with { variant "FIELDLENGTH(64), COMP(signbit), BYTEORDER(first)"};

-

-  //Define Coordinated Universal Time (UTC) values.

-  type DateTime UtcTime;

-

-  //Represents the time in seconds since the year 2000. It is used as version number based on the last change time.

-  type UInt32 VersionTime;

-

-  //Represents the value of a counter

-  type UInt32 Counter;

-

-  //Identifies an element of an array

-  type UInt32 Index;

-

-  //Used as an identifier, such as a handle. All values, except for 0, are valid.

-  type UInt32 IntegerId;

-

-  //Representing an image.

-  type octetstring Image;

-

-  //Representing an image in BMP format.

-  type octetstring ImageBMP;

-

-  //Representing an image in GIF format.

-  type octetstring ImageGIF;

-

-  //Representing an image in JPG format.

-  type octetstring ImageJPG;

-

-  //Representing an image in PNG format.

-  type octetstring ImagePNG;

-

-  //Representing audio data. It can be any number of audio formats.

-  type ByteString AudioData;

-

-  //A string that is composed of a language component and a country/region component

-  type String LocaleId;

-

-  //Used to pause a Browse or QueryFirst operation

-  type ByteString ContinuationPoint;

-

-  //Used for indexing a range within an array

-  type String NumericRange;

-

-  //An opaque identifier that is used to identify requests associated with a particular Session.

-  type NodeId SessionAuthenticationToken;

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                   Complex Types                         //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  //Sequence of UTF-8 characters without a null terminator and preceded by the length in bytes.

-  //A length of -1 is used to indicate a null string

-  type union String {

-    NullArray nullString,

-    NonNullString realString

-  }

-

-  //A 16-byte value that can be used as a globally unique identifier.

-  type record Guid {

-    UInt32 data1,

-    UInt16 data2,

-    UInt16 data3,

-    Byte data41,

-    Byte data42,

-    Byte data43,

-    Byte data44,

-    Byte data45,

-    Byte data46,

-    Byte data47,

-    Byte data48

-  };

-

-  //Sequence of bytes preceded by its length in bytes

-  type union ByteString {

-    NullArray nullByteString,

-    RealByteString realByteString

-  }

-

-  //An XML element, as an XML fragment serialized as UTF-8 string

-  type ByteString XmlElement;

-

-  //An identifier for a node in the address space of an OPC UA Server.

-  type record NodeId {

-    Bit4 mask,

-    Bit namespaceUriBit,

-    Bit serverIndexBit,

-    Bit reservedBit1,

-    Bit reservedBit2,

-    NodeIdType IdType

-  } with {

-    variant (IdType)"CROSSTAG( twoByte, mask = 0;

-                               fourByte, mask = 1;

-                               numeric, mask = 2;

-                               string, mask = 3;

-                               guid, mask = 4;

-                               byteString, mask = 5)";

-  }

-

-  //Helper type, contains the possible body types for NodeId

-  type union NodeIdType {

-    TwoByteNodeId twoByte,

-    FourByteNodeId fourByte,

-    NumericNodeId numeric,

-    StringNodeId string,

-    GuidNodeId guid,

-    ByteStringNodeId byteString

-  }

-

-  //The body of a two byte node id

-  type record TwoByteNodeId {

-    Byte nodeValue

-  }

-

-  //The body of a four byte node id

-  type record FourByteNodeId {

-    Byte nameSpace,

-    UInt16 nodeValue

-  }

-

-  //The body of a numeric node id

-  type record NumericNodeId {

-    Byte nameSpace,

-    UInt32 nodeValue

-  }

-

-  //The body of a string node id

-  type record StringNodeId {

-    UInt16 nameSpace,

-    String nodeValue

-  }

-

-  //The body of a guid node id

-  type record GuidNodeId {

-    UInt16 nameSpace,

-    Guid nodeValue

-  }

-

-  //The body of a byte string node id

-  type record ByteStringNodeId {

-    UInt16 nameSpace,

-    ByteString nodeValue

-  }

-

-  //Extends the NodeId structure by allowing the NamespaceUri to be explicitly specified instead of using the NamespaceIndex.

-  type record ExpandedNodeId {

-    NodeId node,

-    String namespaceUri optional, //not present if null or empty

-    UInt32 serverIndex optional //not present if null

-  }with {

-    variant (namespaceUri) "PRESENCE(node.namespaceUriBit = 1)"

-    variant (serverIndex) "PRESENCE(node.serverIndexBit = 1)"

-  }

-

-  //Implementation of the Extension Object for the Extensible Parameter types

-  type record ExtensibleParameter {

-    Byte encodingByte,

-    Byte twoByteNodeValue optional,

-    Byte namespaceIndex optional,

-    UInt16 fourByteNodeValue optional,

-

-    Byte encoding,

-    Int32 parameterLength optional,

-    ExtensibleParameterBody extensibleParameterBody optional

-  } with {

-

-    variant (twoByteNodeValue)"PRESENCE( encodingByte = 0)";

-    variant (namespaceIndex)"PRESENCE( encodingByte = 1)";

-    variant (fourByteNodeValue)"PRESENCE( encodingByte = 1)";

-

-    variant (parameterLength) "PRESENCE( twoByteNodeValue = 594, fourByteNodeValue = 594,

-                                         twoByteNodeValue = 597, fourByteNodeValue = 597,

-                                         twoByteNodeValue = 600, fourByteNodeValue = 600,

-                                         twoByteNodeValue = 603, fourByteNodeValue = 603,

-                                         twoByteNodeValue = 724, fourByteNodeValue = 724,

-                                         twoByteNodeValue = 727, fourByteNodeValue = 727,

-                                         twoByteNodeValue = 730, fourByteNodeValue = 730,

-                                         twoByteNodeValue = 736, fourByteNodeValue = 736,

-                                         twoByteNodeValue = 739, fourByteNodeValue = 739,

-                                         twoByteNodeValue = 354, fourByteNodeValue = 354,

-                                         twoByteNodeValue = 357, fourByteNodeValue = 357,

-                                         twoByteNodeValue = 360, fourByteNodeValue = 360,

-                                         twoByteNodeValue = 363, fourByteNodeValue = 363,

-                                         twoByteNodeValue = 366, fourByteNodeValue = 366,

-                                         twoByteNodeValue = 369, fourByteNodeValue = 369,

-                                         twoByteNodeValue = 372, fourByteNodeValue = 372,

-                                         twoByteNodeValue = 375, fourByteNodeValue = 375,

-                                         twoByteNodeValue = 1, fourByteNodeValue = 1,

-                                         twoByteNodeValue = 321, fourByteNodeValue = 321,

-                                         twoByteNodeValue = 324, fourByteNodeValue = 324,

-                                         twoByteNodeValue = 327, fourByteNodeValue = 327,

-                                         twoByteNodeValue = 940, fourByteNodeValue = 940,

-                                         twoByteNodeValue = 12901, fourByteNodeValue = 12901,

-                                         twoByteNodeValue = 646, fourByteNodeValue = 646,

-                                         twoByteNodeValue = 649, fourByteNodeValue = 649,

-                                         twoByteNodeValue = 652, fourByteNodeValue = 652,

-                                         twoByteNodeValue = 655, fourByteNodeValue = 655,

-                                         twoByteNodeValue = 658, fourByteNodeValue = 658,

-                                         twoByteNodeValue = 682, fourByteNodeValue = 682,

-                                         twoByteNodeValue = 11300, fourByteNodeValue = 11300,

-                                         twoByteNodeValue = 685, fourByteNodeValue = 685,

-                                         twoByteNodeValue = 688, fourByteNodeValue = 688,

-                                         twoByteNodeValue = 691, fourByteNodeValue = 691,

-                                         twoByteNodeValue = 694, fourByteNodeValue = 694,

-                                         twoByteNodeValue = 811, fourByteNodeValue = 811,

-                                         twoByteNodeValue = 916, fourByteNodeValue = 916,

-                                         twoByteNodeValue = 820, fourByteNodeValue = 820)"

-

-    variant (extensibleParameterBody) "CROSSTAG( elementOperand,  {twoByteNodeValue = 594, fourByteNodeValue = 594};

-                                                 literalOperand,  {twoByteNodeValue = 597, fourByteNodeValue = 597};

-                                                 attributeOperand,  {twoByteNodeValue = 600, fourByteNodeValue = 600};

-                                                 simpleAttributeOperand,  {twoByteNodeValue = 603, fourByteNodeValue = 603};

-                                                 dataChangeFilter, {twoByteNodeValue = 724, fourByteNodeValue = 724};

-                                                 eventFilter, {twoByteNodeValue = 727, fourByteNodeValue = 727};

-                                                 aggregateFilter, {twoByteNodeValue = 730, fourByteNodeValue = 730};

-                                                 eventFilterResult,  {twoByteNodeValue = 736, fourByteNodeValue = 736};

-                                                 aggregateFilterResult,  {twoByteNodeValue = 739, fourByteNodeValue = 739};

-                                                 objectAttributes,  {twoByteNodeValue = 354, fourByteNodeValue = 354};

-                                                 variableAttributes,  {twoByteNodeValue = 357, fourByteNodeValue = 357};

-                                                 methodAttributes,  {twoByteNodeValue = 360, fourByteNodeValue = 360};

-                                                 objectTypeAttributes,  {twoByteNodeValue = 363, fourByteNodeValue = 363};

-                                                 variableTypeAttributes,  {twoByteNodeValue = 366, fourByteNodeValue = 366};

-                                                 referenceTypeAttributes,  {twoByteNodeValue = 369, fourByteNodeValue = 369};

-                                                 dataTypeAttributes,  {twoByteNodeValue = 372, fourByteNodeValue = 372};

-                                                 viewAttributes,  {twoByteNodeValue = 375, fourByteNodeValue = 375};

-                                                 genericAttributes,  {twoByteNodeValue = 1, fourByteNodeValue = 1};

-                                                 anonymousIdentityToken,  {twoByteNodeValue = 321, fourByteNodeValue = 321};

-                                                 userNameIdentityToken,  {twoByteNodeValue = 324, fourByteNodeValue = 324};

-                                                 x509IdentityToken,  {twoByteNodeValue = 327, fourByteNodeValue = 327};

-                                                 issuedIdentityToken,  {twoByteNodeValue = 940, fourByteNodeValue = 940};

-                                                 mdnsDiscoveryConfiguration, {twoByteNodeValue = 12901, fourByteNodeValue = 12901};

-                                                 readEventDetails,  {twoByteNodeValue = 646, fourByteNodeValue = 646};

-                                                 readRawModifiedDetails,  {twoByteNodeValue = 649, fourByteNodeValue = 649};

-                                                 readProcessedDetails,  {twoByteNodeValue = 652, fourByteNodeValue = 652};

-                                                 readAtTimeDetails,  {twoByteNodeValue = 655, fourByteNodeValue = 655};

-                                                 dataValues,  {twoByteNodeValue = 658, fourByteNodeValue = 658};

-                                                 updateDataDetails,  {twoByteNodeValue = 682, fourByteNodeValue = 682};

-                                                 updateStructureDataDetails,  {twoByteNodeValue = 11300, fourByteNodeValue = 11300};

-                                                 updateEventDetails,  {twoByteNodeValue = 685, fourByteNodeValue = 685};

-                                                 deleteRawModifiedDetails,  {twoByteNodeValue = 688, fourByteNodeValue = 688};

-                                                 deleteAtTimeDetails,  {twoByteNodeValue = 691, fourByteNodeValue = 691};

-                                                 deleteEventDetails,  {twoByteNodeValue = 694, fourByteNodeValue = 694};

-                                                 dataChangeNotification,  {twoByteNodeValue = 811, fourByteNodeValue = 811};

-                                                 eventNotificationList,  {twoByteNodeValue = 916, fourByteNodeValue = 916};

-                                                 statusChangeNotification,  {twoByteNodeValue = 820, fourByteNodeValue = 820})"

-  }

-

-  //Possible extension types

-  type union ExtensibleParameterBody {

-    ElementOperand elementOperand,

-    LiteralOperand literalOperand,

-    AttributeOperand attributeOperand,

-    SimpleAttributeOperand simpleAttributeOperand,

-    DataChangeFilter dataChangeFilter,

-    EventFilter eventFilter,

-    AggregateFilter aggregateFilter,

-    EventFilterResult eventFilterResult,

-    AggregateFilterResult aggregateFilterResult,

-    ObjectAttributes objectAttributes,

-    VariableAttributes variableAttributes,

-    MethodAttributes methodAttributes,

-    ObjectTypeAttributes objectTypeAttributes,

-    VariableTypeAttributes variableTypeAttributes,

-    ReferenceTypeAttributes referenceTypeAttributes,

-    DataTypeAttributes dataTypeAttributes,

-    ViewAttributes viewAttributes,

-    GenericAttributes genericAttributes,

-    UserNameIdentityToken userNameIdentityToken,

-    X509IdentityToken x509IdentityToken,

-    IssuedIdentityToken issuedIdentityToken,

-    AnonymousIdentityToken anonymousIdentityToken,

-    MdnsDiscoveryConfiguration mdnsDiscoveryConfiguration,

-    ReadEventDetails readEventDetails,

-    ReadRawModifiedDetails readRawModifiedDetails,

-    ReadProcessedDetails readProcessedDetails,

-    ReadAtTimeDetails readAtTimeDetails,

-    ListOfDataValue dataValues,

-    UpdateDataDetails updateDataDetails,

-    UpdateStructureDataDetails updateStructureDataDetails,

-    UpdateEventDetails updateEventDetails,

-    DeleteRawModifiedDetails deleteRawModifiedDetails,

-    DeleteAtTimeDetails deleteAtTimeDetails,

-    DeleteEventDetails deleteEventDetails,

-    DataChangeNotification dataChangeNotification,

-    EventNotificationList eventNotificationList,

-    StatusChangeNotification statusChangeNotification

-  }

-

-  //A numeric identifier for an error or condition that is associated with a value or an operation.

-  type UInt32 StatusCode;

-

-  //A structure that contains detailed error and diagnostic information associated with a StatusCode.

-  type record DiagnosticInfo {

-    Bit symbolicIdBit,

-    Bit namespaceUriBit,

-    Bit localeBit,

-    Bit localisedTextBit,

-    Bit additionalInfoBit,

-    Bit innerStatusCodeBit,

-    Bit innerDiagnosticInfoBit,

-    Bit reserveBit,

-    Int32 symbolicId optional,

-    Int32 namespaceUri optional,

-    Int32 locale optional,

-    Int32 localisedText optional,

-    String additionalInfo optional,

-    StatusCode innerStatusCode optional,

-    DiagnosticInfo innerDiagnosticInfo optional

-  }with {

-    variant (symbolicId) "PRESENCE(symbolicIdBit = 1)";

-    variant (namespaceUri) "PRESENCE(namespaceUriBit = 1)";

-    variant (locale) "PRESENCE(localeBit = 1)";

-    variant (localisedText) "PRESENCE(localisedTextBit = 1)";

-    variant (additionalInfo) "PRESENCE(additionalInfoBit = 1)";

-    variant (innerStatusCode) "PRESENCE(innerStatusCodeBit = 1)";

-    variant (innerDiagnosticInfo) "PRESENCE(innerDiagnosticInfoBit = 1)";

-  }

-

-  //A name qualified by a namespace.

-  type record QualifiedName {

-    UInt16 namespaceIndex,

-    String name

-  }

-

-  //Human readable text with an optional locale identifier.

-  type record LocalizedText {

-    Bit localeBit,

-    Bit textBit,

-    Bit spareBit1,

-    Bit spareBit2,

-    Bit spareBit3,

-    Bit spareBit4,

-    Bit spareBit5,

-    Bit spareBit6,

-    String locale optional,

-    String text optional

-  } with {

-    variant (locale) "PRESENCE(localeBit = 1)";

-    variant (text) "PRESENCE(textBit = 1)";

-  }

-

-  //A structure that contains an application specific data type that may not be recognized by the receiver

-  type record ExtensionObject {

-    NodeId typeId,

-    Byte encoding,

-    Int32 Length,

-    ExtensionObjectBody body optional

-  } with {

-    variant (body)"CROSSTAG( byteString,  encoding = 1;

-                             xmlElement, encoding = 2)";

-  }

-

-  type union ExtensionObjectBody {

-    ListOfByte byteString,

-    octetstring xmlElement

-  }

-

-  //A union of all of the types specified above.

-  type record Variant {

-    Bit6 encodingBits,

-    Bit arrayDimensionsBit,

-    Bit arrayEncodedBit,

-    Int32 arrayLength optional,

-    VariantSingleValue ValueSingle optional,

-    VariantArrayValue ValueArray optional,

-    Int32 arrayDimensionsLenght optional,

-    ListOfInt32 arrayDimensions optional

-  } with {

-    variant (arrayDimensions) "PRESENCE(arrayDimensionsBit = 1)";

-    variant (arrayDimensionsLenght) "PRESENCE(arrayDimensionsBit = 1)";

-    variant (arrayLength) "PRESENCE(arrayDimensionsBit = 1)";

-

-    variant (ValueSingle) "PRESENCE(arrayEncodedBit = 0)"

-    variant (ValueArray) "PRESENCE(arrayEncodedBit = 1)"

-

-    variant (ValueSingle)"CROSSTAG( bool, encodingBits = 1;

-                                    sbyte, encodingBits = 2;

-                                    byte, encodingBits = 3;

-                                    int16, encodingBits = 4;

-                                    uint16, encodingBits = 5;

-                                    int32, encodingBits = 6;

-                                    uint32, encodingBits = 7;

-                                    int64, encodingBits = 8;

-                                    uint64, encodingBits = 9;

-                                    floatValue, encodingBits = 10;

-                                    double, encodingBits = 11;

-                                    string, encodingBits = 12;

-                                    datetime, encodingBits = 13;

-                                    guid, encodingBits = 14;

-                                    bytestring, encodingBits = 15;

-                                    xmlelement, encodingBits = 16;

-                                    nodeid, encodingBits = 17;

-                                    expandednodeid, encodingBits = 18;

-                                    statuscode, encodingBits = 19;

-                                    qualifiedname, encodingBits = 20;

-                                    localizedtext, encodingBits = 21;

-                                    extensionobject, encodingBits = 22;

-                                    datavalue, encodingBits = 23;

-                                    listofvariant, encodingBits = 24;

-                                    diagnosticinfo, encodingBits = 25)";

-

-    variant (ValueArray)"CROSSTAG( bool, encodingBits = 1;

-                                   sbyte, encodingBits = 2;

-                                   byte, encodingBits = 3;

-                                   int16, encodingBits = 4;

-                                   uint16, encodingBits = 5;

-                                   int32, encodingBits = 6;

-                                   uint32, encodingBits = 7;

-                                   int64, encodingBits = 8;

-                                   uint64, encodingBits = 9;

-                                   floatValue, encodingBits = 10;

-                                   double, encodingBits = 11;

-                                   string, encodingBits = 12;

-                                   datetime, encodingBits = 13;

-                                   guid, encodingBits = 14;

-                                   bytestring, encodingBits = 15;

-                                   xmlelement, encodingBits = 16;

-                                   nodeid, encodingBits = 17;

-                                   expandednodeid, encodingBits = 18;

-                                   statuscode, encodingBits = 19;

-                                   qualifiedname, encodingBits = 20;

-                                   localizedtext, encodingBits = 21;

-                                   extensionobject, encodingBits = 22;

-                                   datavalue, encodingBits = 23;

-                                   listofvariant, encodingBits = 24;

-                                   diagnosticinfo, encodingBits = 25)";

-  }

-

-  //An union of single values for Variant

-  type union VariantSingleValue {

-    Boolean bool,

-    SByte sbyte,

-    Byte byte,

-    Int16 int16,

-    UInt16 uint16,

-    Int32 int32,

-    UInt32 uint32,

-    Int64 int64,

-    UInt64 uint64,

-    Float floatValue,

-    Double double,

-    String string,

-    DateTime datetime,

-    Guid guid,

-    ByteString bytestring,

-    XmlElement xmlelement,

-    NodeId nodeid,

-    ExpandedNodeId expandednodeid,

-    StatusCode statuscode,

-    QualifiedName qualifiedname,

-    LocalizedText localizedtext,

-    ExtensionObject extensionobject,

-    DataValue datavalue,

-    ListOfVariant listofvariant,

-    DiagnosticInfo diagnosticinfo

-  }

-

-  //An union of arrays for Variant

-  type union VariantArrayValue {

-    ListOfBoolean bool,

-    ListOfSByte sbyte,

-    ListOfByte byte,

-    ListOfInt16 int16,

-    ListOfUInt16 uint16,

-    ListOfInt32 int32,

-    ListOfUInt32 uint32,

-    ListOfInt64 int64,

-    ListOfUInt64 uint64,

-    ListOfFloat floatValue,

-    ListOfDouble double,

-    ListOfString string,

-    ListOfDateTime datetime,

-    ListOfGuid guid,

-    ListOfByteString bytestring,

-    ListOfXmlElement xmlelement,

-    ListOfNodeId nodeid,

-    ListOfExpandedNodeId expandednodeid,

-    ListOfStatusCode statuscode,

-    ListOfQualifiedName qualifiedname,

-    ListOfLocalizedText localizedtext,

-    ListOfExtensionObject extensionobject,

-    ListOfDataValue datavalue,

-    ListOfVariant listofvariant,

-    ListOfDiagnosticInfo diagnosticinfo

-  }

-

-  //A data value with an associated status code and timestamps.

-  type record DataValue {

-    Bit ValueBit,

-    Bit statusBit,

-    Bit sourceTimestampBit,

-    Bit serverTimestampBit,

-    Bit sourcePicoSecondsBit,

-    Bit serverPicoSecondsBit,

-    Bit spareBit1,

-    Bit spareBit2,

-    Variant Value optional,

-    StatusCode status optional,

-    DateTime sourceTimestamp optional,

-    UInt16 sourcePicoSeconds optional,

-    DateTime serverTimestamp optional,

-    UInt16 serverPicoSeconds optional

-  } with {

-    variant (Value) "PRESENCE(ValueBit = 1)";

-    variant (status) "PRESENCE(statusBit = 1)";

-    variant (sourceTimestamp) "PRESENCE(sourceTimestampBit = 1)";

-    variant (sourcePicoSeconds) "PRESENCE(sourcePicoSecondsBit = 1)";

-    variant (serverTimestamp) "PRESENCE(serverTimestampBit = 1)";

-    variant (serverPicoSeconds) "PRESENCE(serverPicoSecondsBit = 1)";

-  }

-

-  //A high-precision signed decimal number

-  type record Decimal {

-    NodeId typeId,

-    Byte decimalLength,

-    Int16 scale,

-    Byte decimalValue

-  }

-

-  //Structured DataType defines the local time that may or may not take daylight saving time into account.

-  type record TimeZoneDataType {

-    Int16 offset,

-    Boolean daylightSavingInOffset

-  }

-

-  //Defines a Method input or output argument specification.

-  type record Argument {

-    String name,

-    NodeId dataType,

-    Int32 valueRank,

-    ListOfUInt32 arrayDimensions,

-    LocalizedText description

-  }

-

-  //Represent a human-readable representation of an Enumeration.

-  type record EnumValueType {

-    Int64 Value,

-    LocalizedText displayName,

-    LocalizedText description

-  }

-

-  //Base DataType for all DataTypes representing a bit mask.

-  type record OptionSet {

-    ByteString Value,

-    ByteString validBits

-  }

-

-  //Provides the meta data for a custom Structure DataType.

-  type record StructureDefinition {

-    NodeId defaultEncodingId,

-    NodeId baseDataType,

-    StructureType structureType,

-    ListOfStructureField fields

-  }

-

-  //Provides the metadata for a custom Enumeration or OptionSet DataType.

-  type record EnumDefinition {

-    ListOfEnumField fields

-  }

-

-  //Provides the metadata for a field of a custom Enumeration or OptionSet DataType.

-  type record EnumField {

-    String name

-  }

-

-  //Provides the metadata for a field of a custom Structure DataType.

-  type record StructureField {

-    String name,

-    LocalizedText description,

-    NodeId dataType,

-    Int32 valueRank,

-    Boolean isOptional

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                 Lists and Arrays                        //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  //Arrays of types. Used in lists, and in templates for lists

-  type record of Boolean BooleanArray;

-  type record of SByte SByteArray;

-  type record of Byte ByteArray;

-  type record of Int16 Int16Array;

-  type record of UInt16 UInt16Array;

-  type record of Int32 Int32Array;

-  type record of UInt32 UInt32Array;

-  type record of Int64 Int64Array;

-  type record of UInt64 UInt64Array;

-  type record of Float FloatArray;

-  type record of Double DoubleArray;

-  type record of DateTime DateTimeArray;

-  type record of UtcTime UtcTimeArray;

-  type record of Counter CounterArray;

-  type record of IntegerId IntegerIdArray;

-  type record of LocaleId LocaleIdArray;

-  type record of ContinuationPoint ContinuationPointArray;

-  type record of String StringArray;

-  type record of Guid GuidArray;

-  type record of ByteString ByteStringArray;

-  type record of XmlElement XmlElementArray;

-  type record of NodeId NodeIdArray;

-  type record of ExpandedNodeId ExpandedNodeIdArray;

-  type record of StatusCode StatusCodeArray;

-  type record of DiagnosticInfo DiagnosticInfoArray;

-  type record of QualifiedName QualifiedNameArray;

-  type record of LocalizedText LocalizedTextArray;

-  type record of ExtensionObject ExtensionObjectArray;

-  type record of Variant VariantArray;

-  type record of DataValue DataValueArray;

-  type record of Decimal DecimalArray;

-  type record of EnumValueType EnumValueTypeArray;

-  type record of EnumField EnumFieldArray;

-  type record of StructureField StructureFieldArray;

-  type record of ExtensibleParameter ExtensibleParameterArray;

-  type record of ApplicationDescription ApplicationDescriptionArray;

-  type record of BrowseResult BrowseResultArray;

-  type record of ContentFilterElement ContentFilterElementArray;

-  type record of ContentFilterElementResult ContentFilterElementResultArray;

-  type record of SimpleAttributeOperand SimpleAttributeOperandArray;

-  type record of EndpointDescription EndpointDescriptionArray;

-  type record of MonitoringParameters MonitoringParametersArray;

-  type record of GenericAttributeValue GenericAttributeValueArray;

-  type record of MonitoredItemNotification MonitoredItemNotificationArray;

-  type record of EventFieldList EventFieldListArray;

-  type record of QueryDataSet QueryDataSetArray;

-  type record of ReadValueId ReadValueIdArray;

-  type record of ReferenceDescription ReferenceDescriptionArray;

-  type record of RelativePathElement RelativePathElementArray;

-  type record of ApplicationInstanceCertificate ApplicationInstanceCertificateArray;

-  type record of ChannelSecurityToken ChannelSecurityTokenArray;

-  type record of UserTokenPolicy UserTokenPolicyArray;

-  type record of ServerOnNetwork ServerOnNetworkArray;

-  type record of AddNodesItem AddNodesItemArray;

-  type record of AddNodesResult AddNodesResultArray;

-  type record of AddReferencesItem AddReferencesItemArray;

-  type record of DeleteNodesItem DeleteNodesItemArray;

-  type record of DeleteReferencesItem DeleteReferencesItemArray;

-  type record of SignedSoftwareCertificate SignedSoftwareCertificateArray;

-  type record of BrowseDescription BrowseDescriptionArray;

-  type record of BrowsePath BrowsePathArray;

-  type record of BrowsePathResult BrowsePathResultArray;

-  type record of BrowsePathTarget BrowsePathTargetArray;

-  type record of NodeTypeDescription NodeTypeDescriptionArray;

-  type record of QueryDataDescription QueryDataDescriptionArray;

-  type record of ParsingResult ParsingResultArray;

-  type record of HistoryReadValueId HistoryReadValueIdArray;

-  type record of HistoryReadResult HistoryReadResultArray;

-  type record of WriteValue WriteValueArray;

-  type record of HistoryUpdateResult HistoryUpdateResultArray;

-  type record of CallMethodRequest CallMethodRequestArray;

-  type record of CallMethodResult CallMethodResultArray;

-  type record of MonitoredItemCreateRequest MonitoredItemCreateRequestArray;

-  type record of MonitoredItemCreateResult MonitoredItemCreateResultArray;

-  type record of MonitoredItemModifyRequest MonitoredItemModifyRequestArray;

-  type record of MonitoredItemModifyResult MonitoredItemModifyResultArray;

-  type record of SubscriptionAcknowledgement SubscriptionAcknowledgementArray;

-  type record of TransferResult TransferResultArray;

-

-

-

-  //Custom type for NullArrays, which are indicated with a lenght of -1

-  type record NullArray {

-    Int32 arrayLength

-  } with {

-    variant "PRESENCE(arrayLength = Null_Value)";

-  }

-

-  //Non null arrays. Their length can be zero, or any other positive value

-  type record ListOfBooleanArray {

-    Int32 arrayLength,

-    BooleanArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfSByteArray {

-    Int32 arrayLength,

-    SByteArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfByteArray {

-    Int32 arrayLength,

-    ByteArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfInt16Array {

-    Int32 arrayLength,

-    Int16Array arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfUInt16Array {

-    Int32 arrayLength,

-    UInt16Array arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfInt32Array {

-    Int32 arrayLength,

-    Int32Array arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfUInt32Array {

-    Int32 arrayLength,

-    UInt32Array arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfInt64Array {

-    Int32 arrayLength,

-    Int64Array arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfUInt64Array {

-    Int32 arrayLength,

-    UInt64Array arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfFloatArray {

-    Int32 arrayLength,

-    FloatArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfDoubleArray {

-    Int32 arrayLength,

-    DoubleArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfDateTimeArray {

-    Int32 arrayLength,

-    DateTimeArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfUtcTimeArray {

-    Int32 arrayLength,

-    UtcTimeArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfCounterArray {

-    Int32 arrayLength,

-    CounterArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfIntegerIdArray {

-    Int32 arrayLength,

-    IntegerIdArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfLocaleIdArray {

-    Int32 arrayLength,

-    LocaleIdArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfContinuationPointArray {

-    Int32 arrayLength,

-    ContinuationPointArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record NonNullString {

-    Int32 stringLength,

-    charstring stringValue

-  } with {

-    variant (stringLength) "LENGTHTO(stringValue)";

-  }

-

-  type record ListOfStringArray {

-    Int32 arrayLength,

-    StringArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfGuidArray {

-    Int32 arrayLength,

-    GuidArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record RealByteString {

-    Int32 lengthValue,

-    ByteArray byteStringValue

-  } with {

-    variant (lengthValue) "LENGTHTO(byteStringValue)";

-    variant (lengthValue) "UNIT(elements)"

-  }

-

-  type record ListOfByteStringArray {

-    Int32 arrayLength,

-    ByteStringArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfXmlElementArray {

-    Int32 arrayLength,

-    XmlElementArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfNodeIdArray {

-    Int32 arrayLength,

-    NodeIdArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfExpandedNodeIdArray {

-    Int32 arrayLength,

-    ExpandedNodeIdArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfStatusCodeArray {

-    Int32 arrayLength,

-    StatusCodeArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfDiagnosticInfoArray {

-    Int32 arrayLength,

-    DiagnosticInfoArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfQualifiedNameArray {

-    Int32 arrayLength,

-    QualifiedNameArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfLocalizedTextArray {

-    Int32 arrayLength,

-    LocalizedTextArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfExtensionObjectArray {

-    Int32 arrayLength,

-    ExtensionObjectArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfVariantArray {

-    Int32 arrayLength,

-    VariantArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfDataValueArray {

-    Int32 arrayLength,

-    DataValueArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfDecimalArray {

-    Int32 arrayLength,

-    DecimalArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfEnumValueTypeArray {

-    Int32 arrayLength,

-    EnumValueTypeArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfEnumFieldArray {

-    Int32 arrayLength,

-    EnumFieldArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfStructureFieldArray {

-    Int32 arrayLength,

-    StructureFieldArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfExtensibleParameterArray {

-    Int32 arrayLength,

-    ExtensibleParameterArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfApplicationDescriptionArray {

-    Int32 arrayLength,

-    ApplicationDescriptionArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfBrowseResultArray {

-    Int32 arrayLength,

-    BrowseResultArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfContentFilterElementArray {

-    Int32 arrayLength,

-    ContentFilterElementArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfContentFilterElementResultArray {

-    Int32 arrayLength,

-    ContentFilterElementResultArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfSimpleAttributeOperandArray {

-    Int32 arrayLength,

-    SimpleAttributeOperandArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfEndpointDescriptionArray {

-    Int32 arrayLength,

-    EndpointDescriptionArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfMonitoringParametersArray {

-    Int32 arrayLength,

-    MonitoringParametersArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfGenericAttributeValueArray {

-    Int32 arrayLength,

-    GenericAttributeValueArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfMonitoredItemNotificationArray {

-    Int32 arrayLength,

-    MonitoredItemNotificationArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfEventFieldListArray {

-    Int32 arrayLength,

-    EventFieldListArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfQueryDataSetArray {

-    Int32 arrayLength,

-    QueryDataSetArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfReadValueIdArray {

-    Int32 arrayLength,

-    ReadValueIdArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfReferenceDescriptionArray {

-    Int32 arrayLength,

-    ReferenceDescriptionArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfRelativePathElementArray {

-    Int32 arrayLength,

-    RelativePathElementArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfApplicationInstanceCertificateArray {

-    Int32 arrayLength,

-    ApplicationInstanceCertificateArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfChannelSecurityTokenArray {

-    Int32 arrayLength,

-    ChannelSecurityTokenArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfUserTokenPolicyArray {

-    Int32 arrayLength,

-    UserTokenPolicyArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfServerOnNetworkArray {

-    Int32 arrayLength,

-    ServerOnNetworkArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfAddNodesItemArray {

-    Int32 arrayLength,

-    AddNodesItemArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfAddNodesResultArray {

-    Int32 arrayLength,

-    AddNodesResultArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfAddReferencesItemArray {

-    Int32 arrayLength,

-    AddReferencesItemArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfDeleteNodesItemArray {

-    Int32 arrayLength,

-    DeleteNodesItemArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfDeleteReferencesItemArray {

-    Int32 arrayLength,

-    DeleteReferencesItemArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfSignedSoftwareCertificateArray {

-    Int32 arrayLength,

-    SignedSoftwareCertificateArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfBrowseDescriptionArray {

-    Int32 arrayLength,

-    BrowseDescriptionArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfBrowsePathArray {

-    Int32 arrayLength,

-    BrowsePathArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfBrowsePathResultArray {

-    Int32 arrayLength,

-    BrowsePathResultArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfBrowsePathTargetArray {

-    Int32 arrayLength,

-    BrowsePathTargetArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfNodeTypeDescriptionArray {

-    Int32 arrayLength,

-    NodeTypeDescriptionArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfQueryDataDescriptionArray {

-    Int32 arrayLength,

-    QueryDataDescriptionArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfParsingResultArray {

-    Int32 arrayLength,

-    ParsingResultArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfHistoryReadValueIdArray {

-    Int32 arrayLength,

-    HistoryReadValueIdArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfHistoryReadResultArray {

-    Int32 arrayLength,

-    HistoryReadResultArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfWriteValueArray {

-    Int32 arrayLength,

-    WriteValueArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfHistoryUpdateResultArray {

-    Int32 arrayLength,

-    HistoryUpdateResultArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfCallMethodRequestArray {

-    Int32 arrayLength,

-    CallMethodRequestArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfCallMethodResultArray {

-    Int32 arrayLength,

-    CallMethodResultArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfMonitoredItemCreateRequestArray {

-    Int32 arrayLength,

-    MonitoredItemCreateRequestArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfMonitoredItemCreateResultArray {

-    Int32 arrayLength,

-    MonitoredItemCreateResultArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfMonitoredItemModifyRequestArray {

-    Int32 arrayLength,

-    MonitoredItemModifyRequestArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfMonitoredItemModifyResultArray {

-    Int32 arrayLength,

-    MonitoredItemModifyResultArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfSubscriptionAcknowledgementArray {

-    Int32 arrayLength,

-    SubscriptionAcknowledgementArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  type record ListOfTransferResultArray {

-    Int32 arrayLength,

-    TransferResultArray arrayValues

-  } with {

-    variant (arrayLength) "LENGTHTO(arrayValues)";

-    variant (arrayLength) "UNIT(elements)"

-  }

-

-  //List of types. These are used by the services

-  //Can be null array, or non null array. Null arrays have a length of -1

-  type union ListOfBoolean {

-    NullArray nullArray,

-    ListOfBooleanArray realArray

-  }

-

-  type union ListOfSByte {

-    NullArray nullArray,

-    ListOfSByteArray realArray

-  }

-

-  type union ListOfByte {

-    NullArray nullArray,

-    ListOfByteArray realArray

-  }

-

-  type union ListOfInt16 {

-    NullArray nullArray,

-    ListOfInt16Array realArray

-  }

-

-  type union ListOfUInt16 {

-    NullArray nullArray,

-    ListOfUInt16Array realArray

-  }

-

-  type union ListOfInt32 {

-    NullArray nullArray,

-    ListOfInt32Array realArray

-  }

-

-  type union ListOfUInt32 {

-    NullArray nullArray,

-    ListOfUInt32Array realArray

-  }

-

-  type union ListOfInt64 {

-    NullArray nullArray,

-    ListOfInt64Array realArray

-  }

-

-  type union ListOfUInt64 {

-    NullArray nullArray,

-    ListOfUInt64Array realArray

-  }

-

-  type union ListOfFloat {

-    NullArray nullArray,

-    ListOfFloatArray realArray

-  }

-

-  type union ListOfDouble {

-    NullArray nullArray,

-    ListOfDoubleArray realArray

-  }

-

-  type union ListOfDateTime {

-    NullArray nullArray,

-    ListOfDateTimeArray realArray

-  }

-

-  type union ListOfUtcTime {

-    NullArray nullArray,

-    ListOfUtcTimeArray realArray

-  }

-

-  type union ListOfCounter {

-    NullArray nullArray,

-    ListOfCounterArray realArray

-  }

-

-  type union ListOfIntegerId {

-    NullArray nullArray,

-    ListOfIntegerIdArray realArray

-  }

-

-  type union ListOfLocaleId {

-    NullArray nullArray,

-    ListOfLocaleIdArray realArray

-  }

-

-  type union ListOfContinuationPoint {

-    NullArray nullArray,

-    ListOfContinuationPointArray realArray

-  }

-

-  type union ListOfString {

-    NullArray nullArray,

-    ListOfStringArray realArray

-  }

-

-   type union ListOfGuid {

-    NullArray nullArray,

-    ListOfGuidArray realArray

-  }

-

-  type union ListOfByteString {

-    NullArray nullArray,

-    ListOfByteStringArray realArray

-  }

-

-  type union ListOfXmlElement {

-    NullArray nullArray,

-    ListOfXmlElementArray realArray

-  }

-

-  type union ListOfNodeId {

-    NullArray nullArray,

-    ListOfNodeIdArray realArray

-  }

-

-  type union ListOfExpandedNodeId {

-    NullArray nullArray,

-    ListOfExpandedNodeIdArray realArray

-  }

-

-  type union ListOfStatusCode {

-    NullArray nullArray,

-    ListOfStatusCodeArray realArray

-  }

-

-  type union ListOfDiagnosticInfo {

-    NullArray nullArray,

-    ListOfDiagnosticInfoArray realArray

-  }

-

-  type union ListOfQualifiedName {

-    NullArray nullArray,

-    ListOfQualifiedNameArray realArray

-  }

-

-  type union ListOfLocalizedText {

-    NullArray nullArray,

-    ListOfLocalizedTextArray realArray

-  }

-

-  type union ListOfExtensionObject {

-    NullArray nullArray,

-    ListOfExtensionObjectArray realArray

-  }

-

-  type union ListOfVariant {

-    NullArray nullArray,

-    ListOfVariantArray realArray

-  }

-

-  type union ListOfDataValue {

-    NullArray nullArray,

-    ListOfDataValueArray realArray

-  }

-

-  type union ListOfDecimal {

-    NullArray nullArray,

-    ListOfDecimalArray realArray

-  }

-

-  type union ListOfEnumValueType {

-    NullArray nullArray,

-    ListOfEnumValueTypeArray realArray

-  }

-

-  type union ListOfEnumField {

-    NullArray nullArray,

-    ListOfEnumFieldArray realArray

-  }

-

-  type union ListOfStructureField {

-    NullArray nullArray,

-    ListOfStructureFieldArray realArray

-  }

-

-  type union ListOfExtensibleParameter {

-    NullArray nullArray,

-    ListOfExtensibleParameterArray realArray

-  }

-

-  type union ListOfApplicationDescription {

-    NullArray nullArray,

-    ListOfApplicationDescriptionArray realArray

-  }

-

-  type union ListOfBrowseResult {

-    NullArray nullArray,

-    ListOfBrowseResultArray realArray

-  }

-

-  type union ListOfContentFilterElement {

-    NullArray nullArray,

-    ListOfContentFilterElementArray realArray

-  }

-

-  type union ListOfContentFilterElementResult {

-    NullArray nullArray,

-    ListOfContentFilterElementResultArray realArray

-  }

-

-  type union ListOfSimpleAttributeOperand {

-    NullArray nullArray,

-    ListOfSimpleAttributeOperandArray realArray

-  }

-

-  type union ListOfEndpointDescription {

-    NullArray nullArray,

-    ListOfEndpointDescriptionArray realArray

-  }

-

-  type union ListOfMonitoringParameters {

-    NullArray nullArray,

-    ListOfMonitoringParametersArray realArray

-  }

-

-  type union ListOfGenericAttributeValue {

-    NullArray nullArray,

-    ListOfGenericAttributeValueArray realArray

-  }

-

-  type union ListOfMonitoredItemNotification {

-    NullArray nullArray,

-    ListOfMonitoredItemNotificationArray realArray

-  }

-

-  type union ListOfEventFieldList {

-    NullArray nullArray,

-    ListOfEventFieldListArray realArray

-  }

-

-  type union ListOfQueryDataSet {

-    NullArray nullArray,

-    ListOfQueryDataSetArray realArray

-  }

-

-  type union ListOfReadValueId {

-    NullArray nullArray,

-    ListOfReadValueIdArray realArray

-  }

-

-  type union ListOfReferenceDescription {

-    NullArray nullArray,

-    ListOfReferenceDescriptionArray realArray

-  }

-

-  type union ListOfRelativePathElement {

-    NullArray nullArray,

-    ListOfRelativePathElementArray realArray

-  }

-

-  type union ListOfApplicationInstanceCertificate {

-    NullArray nullArray,

-    ListOfApplicationInstanceCertificateArray realArray

-  }

-

-  type union ListOfChannelSecurityToken {

-    NullArray nullArray,

-    ListOfChannelSecurityTokenArray realArray

-  }

-

-   type union ListOfUserTokenPolicy {

-    NullArray nullArray,

-    ListOfUserTokenPolicyArray realArray

-  }

-

-  type union ListOfServerOnNetwork {

-    NullArray nullArray,

-    ListOfServerOnNetworkArray realArray

-  }

-

-  type union ListOfAddNodesItem {

-    NullArray nullArray,

-    ListOfAddNodesItemArray realArray

-  }

-

-  type union ListOfAddNodesResult {

-    NullArray nullArray,

-    ListOfAddNodesResultArray realArray

-  }

-

-  type union ListOfAddReferencesItem {

-    NullArray nullArray,

-    ListOfAddReferencesItemArray realArray

-  }

-

-  type union ListOfDeleteNodesItem {

-    NullArray nullArray,

-    ListOfDeleteNodesItemArray realArray

-  }

-

-  type union ListOfDeleteReferencesItem {

-    NullArray nullArray,

-    ListOfDeleteReferencesItemArray realArray

-  }

-

-  type union ListOfSignedSoftwareCertificate {

-    NullArray nullArray,

-    ListOfSignedSoftwareCertificateArray realArray

-  }

-

-  type union ListOfBrowseDescription {

-    NullArray nullArray,

-    ListOfBrowseDescriptionArray realArray

-  }

-

-  type union ListOfBrowsePath {

-    NullArray nullArray,

-    ListOfBrowsePathArray realArray

-  }

-

-  type union ListOfBrowsePathResult {

-    NullArray nullArray,

-    ListOfBrowsePathResultArray realArray

-  }

-

-  type union ListOfBrowsePathTarget {

-    NullArray nullArray,

-    ListOfBrowsePathTargetArray realArray

-  }

-

-  type union ListOfNodeTypeDescription {

-    NullArray nullArray,

-    ListOfNodeTypeDescriptionArray realArray

-  }

-

-  type union ListOfQueryDataDescription {

-    NullArray nullArray,

-    ListOfQueryDataDescriptionArray realArray

-  }

-

-  type union ListOfParsingResult {

-    NullArray nullArray,

-    ListOfParsingResultArray realArray

-  }

-

-  type union ListOfHistoryReadValueId {

-    NullArray nullArray,

-    ListOfHistoryReadValueIdArray realArray

-  }

-

-  type union ListOfHistoryReadResult {

-    NullArray nullArray,

-    ListOfHistoryReadResultArray realArray

-  }

-

-  type union ListOfWriteValue {

-    NullArray nullArray,

-    ListOfWriteValueArray realArray

-  }

-

-  type union ListOfHistoryUpdateResult {

-    NullArray nullArray,

-    ListOfHistoryUpdateResultArray realArray

-  }

-

-  type union ListOfCallMethodRequest {

-    NullArray nullArray,

-    ListOfCallMethodRequestArray realArray

-  }

-

-  type union ListOfCallMethodResult {

-    NullArray nullArray,

-    ListOfCallMethodResultArray realArray

-  }

-

-  type union ListOfMonitoredItemCreateRequest {

-    NullArray nullArray,

-    ListOfMonitoredItemCreateRequestArray realArray

-  }

-

-  type union ListOfMonitoredItemCreateResult {

-    NullArray nullArray,

-    ListOfMonitoredItemCreateResultArray realArray

-  }

-

-  type union ListOfMonitoredItemModifyRequest {

-    NullArray nullArray,

-    ListOfMonitoredItemModifyRequestArray realArray

-  }

-

-  type union ListOfMonitoredItemModifyResult {

-    NullArray nullArray,

-    ListOfMonitoredItemModifyResultArray realArray

-  }

-

-  type union ListOfSubscriptionAcknowledgement {

-    NullArray nullArray,

-    ListOfSubscriptionAcknowledgementArray realArray

-  }

-

-  type union ListOfTransferResult {

-    NullArray nullArray,

-    ListOfTransferResultArray realArray

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                    Common Parameters                    //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  //Information that describes an application.

-  type record ApplicationDescription {

-    String applicationUri,

-    String productUri,

-    LocalizedText applicationName,

-    ApplicationType applicationType,

-    String gatewayServerUri,

-    String discoveryProfileUri,

-    ListOfString discoveryUrls

-  }

-

-  //Information that identified an application instance

-  type record ApplicationInstanceSubjectIdentifier {

-    String name

-  }

-

-  //Information that identified the issuer of an application instance

-  type record ApplicationInstanceIssuerIdentifier {

-    String productName ,

-    String organisation

-  }

-

-  type record BrowseResult {

-    StatusCode statusCode,

-    ContinuationPoint continuationPoint,

-    ListOfReferenceDescription References

-  }

-

-  type record ContentFilter {

-    ListOfContentFilterElement elements

-  }

-

-  type record ContentFilterElement {

-    FilterOperator filterOperator,

-    ListOfExtensibleParameter filterOperands

-  }

-

-  type record ContentFilterResult {

-    ListOfContentFilterElementResult elementResults,

-    ListOfDiagnosticInfo elementDiagnosticInfos

-  }

-

-  type record ContentFilterElementResult {

-    StatusCode statusCode,

-    ListOfStatusCode operandStatusCodes,

-    ListOfDiagnosticInfo operandDiagnosticInfos

-  }

-

-  type record ElementOperand {

-    UInt32 index

-  }

-

-  type record LiteralOperand {

-    BaseDataType Value

-  }

-

-  type record AttributeOperand {

-    NodeId nodeId,

-    String alias,

-    RelativePath browsePath,

-    IntegerId attributeId,

-    NumericRange indexRange

-  }

-

-  type record SimpleAttributeOperand {

-    NodeId typeId,

-    ListOfQualifiedName browsePath,

-    IntegerId attributeId,

-    NumericRange indexRange

-  }

-

-  type record MdnsDiscoveryConfiguration {

-    String mdnsServerName,

-    ListOfString serverCapabilities

-  }

-

-  type record EndpointDescription {

-    String endpointUrl,

-    ApplicationDescription server,

-    ByteString  serverCertificate,

-    MessageSecurityMode securityMode,

-    String securityPolicyUri,

-    ListOfUserTokenPolicy userIdentityTokens,

-    String transportProfileUri,

-    Byte securityLevel

-  }

-

-  type record MonitoringParameters {

-    IntegerId clientHandle,

-    Duration samplingInterval,

-    ExtensibleParameter filter,

-    Counter queueSize,

-    Boolean discardOldest

-  }

-

-  type record DataChangeFilter {

-    DataChangeTrigger Trigger,

-    UInt32 deadbandType,

-    Double deadbandValue

-  }

-

-  type record EventFilter {

-    ListOfSimpleAttributeOperand selectClauses,

-    ContentFilter whereClause

-  }

-

-  type record EventFilterResult {

-    ListOfStatusCode selectClauseResults,

-    ListOfDiagnosticInfo selectClauseDiagnosticInfos,

-    ContentFilterResult whereClauseResult

-  }

-

-  type record AggregateFilter {

-    UtcTime startTime,

-    NodeId aggregateType,

-    Duration processingInterval,

-    AggregateConfiguration aggregateConfiguration,

-    Boolean useServerCapabilitiesDefaults,

-    Boolean treatUncertainAsBad,

-    Byte percentDataBad,

-    Byte percentDataGood,

-    Boolean useSlopedExtrapolation

-  }

-

-  type record AggregateConfiguration {

-    Boolean TreatUncertainAsBad,

-    Boolean useSeverCapabilitiesDefaults,

-    Byte PercentDataBad,

-    Byte PercentDataGood,

-    Boolean UseSlopedExtrapolation

-  }

-

-  type record AggregateFilterResult {

-    UtcTime revisedStartTime,

-    Duration revisedProcessingInterval

-  }

-

-  type record ObjectAttributes {

-    Bit displayNameBit,

-    Bit descriptionBit,

-    Bit eventNotifierBit,

-    Bit writeMaskBit,

-    Bit userWriteMaskBit,

-    Bit reserveBits[25],

-    LocalizedText displayName optional,

-    LocalizedText description optional,

-    Byte eventNotifier optional,

-    UInt32 writeMask optional,

-    UInt32 userWriteMask optional

-  } with {

-    variant (displayName) "PRESENCE(displayNameBit = 1)";

-    variant (description) "PRESENCE(descriptionBit = 1)";

-    variant (eventNotifier) "PRESENCE(eventNotifierBit = 1)";

-    variant (writeMask) "PRESENCE(writeMaskBit = 1)";

-    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";

-  }

-

-  type record VariableAttributes {

-    Bit displayNameBit,

-    Bit descriptionBit,

-    Bit ValueBit,

-    Bit dataTypeBit,

-    Bit valueRankBit,

-    Bit arrayDimensionsBit,

-    Bit accessLevelBit,

-    Bit userAccessLevelBit,

-    Bit minimumSamplingIntervalBit,

-    Bit historizingBit,

-    Bit writeMaskBit,

-    Bit userWriteMaskBit,

-    Bit reserveBits[20],

-    LocalizedText displayName optional,

-    LocalizedText description optional,

-    DataType Value optional,

-    NodeId dataType optional,

-    Int32 valueRank optional,

-    ListOfUInt32 arrayDimensions optional,

-    Byte accessLevel optional,

-    Byte userAccessLevel optional,

-    Duration minimumSamplingInterval optional,

-    Boolean historizing optional,

-    UInt32 writeMask optional,

-    UInt32 userWriteMask optional

-  }with {

-    variant (displayName) "PRESENCE(displayNameBit = 1)";

-    variant (description) "PRESENCE(descriptionBit = 1)";

-    variant (Value) "PRESENCE(ValueBit = 1)";

-    variant (dataType) "PRESENCE(dataTypeBit = 1)";

-    variant (valueRank) "PRESENCE(valueRankBit = 1)";

-    variant (arrayDimensions) "PRESENCE(arrayDimensionsBit = 1)";

-    variant (accessLevel) "PRESENCE(accessLevelBit = 1)";

-    variant (userAccessLevel) "PRESENCE(userAccessLevelBit = 1)";

-    variant (minimumSamplingInterval) "PRESENCE(minimumSamplingIntervalBit = 1)";

-    variant (historizing) "PRESENCE(historizingBit = 1)";

-    variant (writeMask) "PRESENCE(writeMaskBit = 1)";

-    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";

-  }

-

-  type record MethodAttributes {

-    Bit displayNameBit,

-    Bit descriptionBit,

-    Bit executableBit,

-    Bit userExecutableBit,

-    Bit writeMaskBit,

-    Bit userWriteMaskBit,

-    Bit reserveBits[26],

-    LocalizedText displayName optional,

-    LocalizedText description optional,

-    Boolean executable optional,

-    Boolean userExecutable optional,

-    UInt32 writeMask optional,

-    UInt32 userWriteMask optional

-  } with {

-    variant (displayName) "PRESENCE(displayNameBit = 1)";

-    variant (description) "PRESENCE(descriptionBit = 1)";

-    variant (executable) "PRESENCE(executableBit = 1)";

-    variant (userExecutable) "PRESENCE(userExecutableBit = 1)";

-    variant (writeMask) "PRESENCE(writeMaskBit = 1)";

-    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";

-  }

-

-  type record ObjectTypeAttributes {

-    Bit displayNameBit,

-    Bit descriptionBit,

-    Bit isAbstractBit,

-    Bit writeMaskBit,

-    Bit userWriteMaskBit,

-    Bit reserveBits[27],

-    LocalizedText displayName optional,

-    LocalizedText description optional,

-    Boolean isAbstract optional,

-    UInt32 writeMask optional,

-    UInt32 userWriteMask optional

-  } with {

-    variant (displayName) "PRESENCE(displayNameBit = 1)";

-    variant (description) "PRESENCE(descriptionBit = 1)";

-    variant (isAbstract) "PRESENCE(isAbstractBit = 1)";

-    variant (writeMask) "PRESENCE(writeMaskBit = 1)";

-    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";

-  }

-

-  type record VariableTypeAttributes {

-    Bit displayNameBit,

-    Bit descriptionBit,

-    Bit ValueBit,

-    Bit dataTypeBit,

-    Bit valueRankBit,

-    Bit arrayDimensionsBit,

-    Bit isAbstractBit,

-    Bit writeMaskBit,

-    Bit userWriteMaskBit,

-    Bit reserveBits[23],

-    LocalizedText displayName optional,

-    LocalizedText description optional,

-    DataType Value optional,

-    NodeId dataType optional,

-    Int32 valueRank optional,

-    ListOfUInt32 arrayDimensions optional,

-    Boolean isAbstract optional,

-    UInt32 writeMask optional,

-    UInt32 userWriteMask optional

-  } with {

-    variant (displayName) "PRESENCE(displayNameBit = 1)";

-    variant (description) "PRESENCE(descriptionBit = 1)";

-    variant (Value) "PRESENCE(ValueBit = 1)";

-    variant (dataType) "PRESENCE(dataTypeBit = 1)";

-    variant (valueRank) "PRESENCE(valueRankBit = 1)";

-    variant (arrayDimensions) "PRESENCE(arrayDimensionsBit = 1)";

-    variant (isAbstract) "PRESENCE(isAbstractBit = 1)";

-    variant (writeMask) "PRESENCE(writeMaskBit = 1)";

-    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";

-  }

-

-  type record ReferenceTypeAttributes {

-    Bit displayNameBit,

-    Bit descriptionBit,

-    Bit isAbstractBit,

-    Bit symmetricBit,

-    Bit inverseNameBit,

-    Bit writeMaskBit,

-    Bit userWriteMaskBit,

-    Bit reserveBits[25],

-    LocalizedText displayName optional,

-    LocalizedText description optional,

-    Boolean isAbstract optional,

-    Boolean symmetric optional,

-    LocalizedText inverseName optional,

-    UInt32 writeMask optional,

-    UInt32 userWriteMask optional

-  } with {

-    variant (displayName) "PRESENCE(displayNameBit = 1)";

-    variant (description) "PRESENCE(descriptionBit = 1)";

-    variant (isAbstract) "PRESENCE(isAbstractBit = 1)";

-    variant (symmetric) "PRESENCE(symmetricBit = 1)";

-    variant (inverseName) "PRESENCE(inverseNameBit = 1)";

-    variant (writeMask) "PRESENCE(writeMaskBit = 1)";

-    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";

-  }

-

-  type record DataTypeAttributes {

-    Bit displayNameBit,

-    Bit descriptionBit,

-    Bit isAbstractBit,

-    Bit writeMaskBit,

-    Bit userWriteMaskBit,

-    Bit reserveBits[27],

-    LocalizedText displayName optional,

-    LocalizedText description optional,

-    Boolean isAbstract optional,

-    UInt32 writeMask optional,

-    UInt32 userWriteMask optional

-  } with {

-    variant (displayName) "PRESENCE(displayNameBit = 1)";

-    variant (description) "PRESENCE(descriptionBit = 1)";

-    variant (isAbstract) "PRESENCE(isAbstractBit = 1)";

-    variant (writeMask) "PRESENCE(writeMaskBit = 1)";

-    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";

-  }

-

-  type record ViewAttributes {

-    Bit displayNameBit,

-    Bit descriptionBit,

-    Bit containsNoLoopsBit,

-    Bit eventNotifierBit,

-    Bit writeMaskBit,

-    Bit userWriteMaskBit,

-    Bit reserveBits[26],

-    LocalizedText displayName optional,

-    LocalizedText description optional,

-    Boolean containsNoLoops optional,

-    Byte eventNotifier optional,

-    UInt32 writeMask optional,

-    UInt32 userWriteMask optional

-  } with {

-    variant (displayName) "PRESENCE(displayNameBit = 1)";

-    variant (description) "PRESENCE(descriptionBit = 1)";

-    variant (containsNoLoops) "PRESENCE(containsNoLoopsBit = 1)";

-    variant (eventNotifier) "PRESENCE(eventNotifierBit = 1)";

-    variant (writeMask) "PRESENCE(writeMaskBit = 1)";

-    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";

-  }

-

-  type record GenericAttributes {

-    ListOfGenericAttributeValue attributeValues

-  }

-

-  type record GenericAttributeValue {

-    IntegerId attributeId,

-    BaseDataType Value

-  }

-

-  type record DataChangeNotification {

-    ListOfMonitoredItemNotification monitoredItems,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record MonitoredItemNotification {

-    IntegerId clientHandle,

-    DataValue Value

-  }

-

-  type record EventNotificationList {

-    ListOfEventFieldList events

-  }

-

-  type record EventFieldList {

-    IntegerId clientHandle,

-    ListOfBaseDataType eventFields

-  }

-

-  type record StatusChangeNotification {

-    StatusCode status,

-    DiagnosticInfo diagnosticInfo

-  }

-

-  type record NotificationMessage {

-    Counter sequenceNumber,

-    UtcTime publishTime,

-    ListOfExtensibleParameter notificationData

-  }

-

-  type record QueryDataSet {

-    ExpandedNodeId nodeId,

-    ExpandedNodeId typeDefinitionNode,

-    ListOfBaseDataType values

-  }

-

-  type record ReadValueId {

-    NodeId nodeId,

-    IntegerId attributeId,

-    NumericRange indexRange,

-    QualifiedName dataEncoding

-  }

-

-  type record ReferenceDescription {

-    NodeId referenceTypeId,

-    Boolean isForward,

-    ExpandedNodeId nodeId,

-    QualifiedName browseName,

-    LocalizedText displayName,

-    NodeClass nodeClass,

-    ExpandedNodeId typeDefinition

-  }

-

-  type record RelativePath {

-    ListOfRelativePathElement elements

-  }

-

-  type record RelativePathElement {

-    NodeId referenceTypeId,

-    Boolean isInverse,

-    Boolean includeSubtypes,

-    QualifiedName targetName

-  }

-

-  type record RegisteredServer {

-    String serverUri,

-    String productUri,

-    ListOfLocalizedText serverNames,

-    ApplicationType serverType,

-    String gatewayServerUri,

-    ListOfString discoveryUrls,

-    String semaphoreFilePath,

-    Boolean isOnline

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //         Structures for Security (Incomplete)            //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record ApplicationInstanceCertificate {

-    String version,

-    ByteString serialNumber,

-    String signatureAlgorithm,

-    ByteString Signature,

-    ApplicationInstanceIssuerIdentifier issuer,

-    UtcTime validFrom,

-    UtcTime validTo,

-    ApplicationInstanceSubjectIdentifier subject,

-    String applicationUri,

-    ListOfString hostnames,

-    ByteString publicKey,

-    ListOfString keyUsage

-  }

-

-  type record ChannelSecurityToken {

-    UInt32 channelId,

-    UInt32 tokenId,

-    UtcTime createdAt,

-    UInt32 revisedLifetime

-  }

-

-  type record EncryptedSecret {

-    NodeId TypeId,

-    Byte EncodingMask,

-    UInt32 Length,

-    String SecurityPolicyUri,

-    ByteString EncryptingCertificate,

-    DateTime SigningTime,

-    UInt16 PolicyHeaderLength,

-    ByteString SigningKey,

-    ByteString EncryptingKey,

-    ByteString InitializationVector,

-    ByteString Nonce,

-    Byte PolicyHeaderPadding optional,

-    UInt16 PolicyHeaderPaddingSize,

-    ByteString Secret,

-    Byte PayloadPadding optional,

-    UInt16 PayloadPaddingSize,

-    Byte Signature optional

-  }

-

-  type record RsaEncryptedSecret {

-    NodeId TypeId,

-    Byte EncodingMask,

-    UInt32 Length,

-    String SecurityPolicyUri,

-    ByteString EncryptingCertificate,

-    DateTime SigningTime,

-    UInt16 PolicyHeaderLength,

-    ByteString SigningKey,

-    ByteString EncryptingKey,

-    ByteString InitializationVector,

-    ByteString Nonce,

-    Byte PolicyHeaderPadding optional,

-    UInt16 PolicyHeaderPaddingSize,

-    ByteString Secret,

-    Byte PayloadPadding optional,

-    UInt16 PayloadPaddingSize,

-    Byte Signature optional

-  }

-

-  type record AnonymousIdentityToken {

-    String policyId

-  }

-

-  type record UserNameIdentityToken {

-    String policyId,

-    String userName,

-    ByteString password,

-    String encryptionAlgorithm

-  }

-

-  type record X509IdentityToken {

-    String policyId,

-    ByteString certificateData

-  }

-

-  type record IssuedIdentityToken {

-    String policyId,

-    ByteString tokenData,

-    String encryptionAlgorithm

-  }

-

-  type record UserTokenPolicy {

-    String policyId,

-    UserIdentityTokenType tokenType,

-    String issuedTokenType,

-    String issuerEndpointUrl,

-    String securityPolicyUri

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                 Structures for  Services                //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record ViewDescription {

-    NodeId viewId,

-    UtcTime timestamp,

-    UInt32 viewVersion

-  }

-

-  type record TrustListDataType {

-    TrustListMasks specifiedLists,

-    ListOfByteString trustedCertificates,

-    ListOfByteString trustedCrls,

-    ListOfByteString issuerCertificates,

-    ListOfByteString issuerCrls

-  }

-

-  type record ServerOnNetwork {

-    UInt32 recordId,

-    String serverName,

-    String discoveryUrl,

-    ListOfString serverCapabilities

-  }

-

-  type record AddNodesItem {

-    ExpandedNodeId parentNodeId,

-    NodeId referenceTypeId,

-    QualifiedName browseName,

-    NodeClass nodeClass,

-    ExtensibleParameter nodeAttributes,

-    ExpandedNodeId typeDefinition

-  }

-

-  type record AddNodesResult {

-    StatusCode statusCode,

-    NodeId addedNodeId,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record AddReferencesItem {

-    NodeId sourceNodeId,

-    NodeId referenceTypeId,

-    Boolean isForward,

-    String targetServerUri,

-    ExpandedNodeId targetNodeId,

-    NodeClass targetNodeClass

-  }

-

-  type record DeleteNodesItem {

-    NodeId nodeId,

-    Boolean deleteTargetReferences

-  }

-

-  type record DeleteReferencesItem {

-    NodeId sourceNodeId,

-    NodeId referenceTypeId,

-    Boolean isForward,

-    ExpandedNodeId targetNodeId,

-    Boolean deleteBidirectional

-  }

-

-    type record BrowseDescription {

-    NodeId nodeId,

-    BrowseDirection browseDirection,

-    NodeId referenceTypeId,

-    Boolean includeSubtypes,

-    UInt32 nodeClassMask,

-    UInt32 resultMask

-  }

-

-  type record SignatureData {

-    String algorithm,

-    ByteString Signature

-  }

-

-  type record SignedSoftwareCertificate {

-    ByteString certificateData,

-    ByteString Signature

-  }

-

-  type record BrowsePath {

-    NodeId startingNode,

-    RelativePath relativePath

-  }

-

-  type record BrowsePathResult {

-    StatusCode statusCode,

-    ListOfBrowsePathTarget targets

-  }

-

-  type record BrowsePathTarget {

-    ExpandedNodeId targetId,

-    Index remainingPathIndex

-  }

-

-  type record NodeTypeDescription {

-    ExpandedNodeId typeDefinitionNode,

-    Boolean includeSubtypes,

-    ListOfQueryDataDescription dataToReturn

-  }

-

-  type record QueryDataDescription {

-    RelativePath relativePath,

-    IntegerId attributeId,

-    NumericRange indexRange

-  }

-

-  type record ParsingResult {

-    StatusCode statusCode,

-    ListOfStatusCode dataStatusCodes,

-    ListOfDiagnosticInfo dataDiagnosticInfos

-  }

-

-  type record ReadEventDetails {

-    Counter numValuesPerNode,

-    UtcTime startTime,

-    UtcTime endTime,

-    EventFilter Filter

-  }

-

-  type record ReadRawModifiedDetails {

-    Boolean isReadModified ,

-    UtcTime startTime,

-    UtcTime endTime,

-    Counter numValuesPerNode,

-    Boolean returnBounds

-  }

-

-  type record ReadProcessedDetails {

-    UtcTime startTime,

-    UtcTime endTime,

-    Duration ProcessingInterval,

-    ListOfNodeId aggregateType,

-    AggregateConfiguration aggregateConfiguration

-  }

-

-  type record ReadAtTimeDetails {

-    ListOfUtcTime reqTimes,

-    Boolean useSimpleBounds

-  }

-

-  type record HistoryReadValueId {

-    NodeId nodeId,

-    NumericRange indexRange,

-    QualifiedName dataEncoding,

-    ByteString continuationPoint

-  }

-

-  type record HistoryReadResult {

-    StatusCode statusCode,

-    ByteString continuationPoint,

-    ExtensibleParameter historyData

-  }

-

-  type record WriteValue {

-    NodeId nodeId,

-    IntegerId attributeId,

-    NumericRange indexRange,

-    DataValue datavalue

-  }

-

-  type record UpdateDataDetails {

-    NodeId nodeId,

-    PerformUpdateType performInsertReplace,

-    ListOfDataValue updateValues

-  }

-

-  type record UpdateStructureDataDetails {

-    NodeId nodeId,

-    PerformUpdateTypeExtended performInsertReplace,

-    ListOfDataValue updateValues

-  }

-

-  type record UpdateEventDetails {

-    NodeId nodeId,

-    PerformUpdateType performInsertReplace,

-    EventFilter filter,

-    ListOfDataValue updateValues

-  }

-

-  type record DeleteRawModifiedDetails {

-    NodeId nodeId,

-    Boolean isDeleteModified,

-    UtcTime startTime,

-    UtcTime endTime

-  }

-

-  type record DeleteAtTimeDetails {

-    NodeId nodeId,

-    ListOfUtcTime reqTimes

-  }

-

-  type record DeleteEventDetails {

-    NodeId nodeId,

-    ListOfByteString eventId

-  }

-

-  type record HistoryUpdateResult {

-    StatusCode statusCode,

-    ListOfStatusCode operationResults,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record CallMethodRequest {

-    NodeId objectId,

-    NodeId methodId,

-    ListOfVariant inputArguments

-  }

-

-  type record CallMethodResult {

-    StatusCode statusCode,

-    ListOfStatusCode inputArgumentResults,

-    ListOfDiagnosticInfo inputArgumentDiagnosticInfos,

-    ListOfVariant outputArguments

-  }

-

-  type record MonitoredItemCreateRequest {

-    ReadValueId itemToMonitor,

-    MonitoringMode monitoringMode,

-    MonitoringParameters requestedParameters

-  }

-

-  type record MonitoredItemCreateResult {

-    StatusCode statusCode,

-    IntegerId monitoredItemId,

-    Duration revisedSamplingInterval,

-    Counter revisedQueueSize,

-    ExtensibleParameter filterResult

-  }

-

-  type record MonitoredItemModifyRequest {

-    IntegerId monitoredItemId,

-    MonitoringParameters requestedParameters

-  }

-

-  type record MonitoredItemModifyResult {

-    StatusCode statusCode,

-    Duration revisedSamplingInterval,

-    Counter revisedQueueSize,

-    ExtensibleParameter filterResult

-  }

-

-  type record SubscriptionAcknowledgement {

-    IntegerId subscriptionId,

-    Counter sequenceNumber

-  }

-

-  type record TransferResult {

-    StatusCode statusCode,

-    ListOfCounter availableSequenceNumbers

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                         Headers                         //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-

-  type record MessageHeader {

-    UInt24 messageType,

-    Byte chunkType,

-    UInt32 messageSize

-  }

-

-  type union SecurityHeader {

-    AsymmetricSecurityHeader asymmetricSecurityHeader,

-    SymmetricSecurityHeader symmetricSecurityHeader

-  }

-

-  type record SequenceHeader {

-    UInt32 SequenceNumber,

-    UInt32 RequestId

-  }

-

-  type record AsymmetricSecurityHeader {

-    Int32 SecurityPolicyUriLength,

-    ListOfByte SecurityPolicyUri,

-    Int32 SenderCertificateLength,

-    ListOfByte SenderCertificate,

-    Int32 ReceiverCertificateThumbprintLength,

-    ListOfByte ReceiverCertificateThumbprint

-  }

-

-  type record SymmetricSecurityHeader {

-    UInt32 TokenId

-  }

-

-  type record MessageFooter {

-    Byte PaddingSize optional,

-    ListOfByte Padding optional,

-    Byte ExtraPaddingSize optional,

-    ListOfByte Signature optional

-  } with {

-    variant (PaddingSize) "LENGTHTO(Padding)";

-  }

-

-  type record AdditionalHeader {

-    ExpandedNodeId typeId,

-    Byte Value

-  }

-

-  type record RequestHeader {

-    SessionAuthenticationToken authenticationToken,

-    UtcTime timestamp,

-    IntegerId requestHandle,

-    UInt32 returnDiagnostics,

-    String auditEntryId,

-    UInt32 timeoutHint,

-    AdditionalHeader additionalHeader

-  }

-

-  type record ResponseHeader {

-    UtcTime timestamp,

-    IntegerId requestHandle,

-    StatusCode serviceResult,

-    DiagnosticInfo serviceDiagnostics,

-    ListOfString stringTable,

-    AdditionalHeader additionalHeader

-  }

-

-  type record ServiceFault {

-    ResponseHeader responseHeader

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                     Basic Messages                      //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record HelloMessage {

-    UInt32 version,

-    UInt32 receiveBufferSize,

-    UInt32 sendBufferSize,

-    UInt32 maxMessageSize,

-    UInt32 maxChunkCount,

-    String endPointUrl

-  }

-

-  type record AckMessage {

-    UInt32 version,

-    UInt32 receiveBufferSize,

-    UInt32 sendBufferSize,

-    UInt32 maxMessageSize,

-    UInt32 maxChunkCount

-  }

-

-  type record ErrorMessage {

-    UInt32 errorCode,

-    String reason

-  }

-

-  type record ReverseHelloMessage {

-    String serverUri,

-    String endPointUrl

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                 Discovery Service Sets                  //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record FindServiceRequest {

-    RequestHeader requestHeader,

-    String endpointUrl,

-    ListOfLocaleId localeIds,

-    ListOfString serverUris

-  }

-

-  type record FindServiceResponse {

-    ResponseHeader responseHeader,

-    ListOfApplicationDescription servers

-  }

-

-  type record FindServersOnNetworkRequest {

-    RequestHeader requestHeader,

-    Counter startingRecordId,

-    UInt32 maxRecordsToReturn,

-    ListOfString serverCapabilityFilter

-  }

-

-  type record FindServersOnNetworkResponse {

-    ResponseHeader responseHeader,

-    UtcTime lastCounterResetTime,

-    ListOfServerOnNetwork servers

-  }

-

-  type record GetEndpointsRequest {

-    RequestHeader requestHeader,

-    String endpointUrl,

-    ListOfLocaleId localeIds,

-    ListOfString profileUris

-  }

-

-  type record GetEndpointsResponse {

-    ResponseHeader responseHeader,

-    ListOfEndpointDescription Endpoints

-  }

-

-  type record RegisterServerRequest {

-    RequestHeader requestHeader,

-    RegisteredServer server

-  }

-

-  type record RegisterServerResponse {

-    ResponseHeader responseHeader

-  }

-

-  type record RegisterServer2Request {

-    RequestHeader requestHeader,

-    RegisteredServer server,

-    ListOfExtensibleParameter discoveryConfiguration

-  }

-

-  type record RegisterServer2Response {

-    ResponseHeader responseHeader,

-    ListOfStatusCode configurationResults,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //               SecureChannel Service Sets                //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record OpenSecureChannelRequest {

-    RequestHeader requestHeader,

-    UInt32 clientProtocolVersion,

-    SecurityTokenRequestType requestType,

-    MessageSecurityMode securityMode,

-    ByteString clientNonce,

-    UInt32 requestedLifetime

-  }

-

-  type record OpenSecureChannelResponse {

-    ResponseHeader responseHeader,

-    UInt32 serverProtocolVersion,

-    ChannelSecurityToken securityToken,

-    ByteString serverNonce

-  }

-

-  type record CloseSecureChannelRequest {

-    RequestHeader requestHeader

-  }

-

-  type record CloseSecureChannelResponse {

-    ResponseHeader responseHeader

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                Session Service Sets                     //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record CreateSessionRequest {

-    RequestHeader requestHeader,

-    ApplicationDescription clientDescription,

-    String serverUri,

-    String endpointUrl,

-    String sessionName,

-    ByteString clientNonce,

-    ByteString clientCertificate,

-    Duration requestedSessionTimeout,

-    UInt32 maxResponseMessageSize

-  }

-

-  type record CreateSessionResponse {

-    ResponseHeader responseHeader,

-    NodeId sessionId,

-    SessionAuthenticationToken authenticationToken,

-    Duration revisedSessionTimeout,

-    ByteString serverNonce,

-    ByteString serverCertificate,

-    ListOfEndpointDescription serverEndpoints,

-    ListOfSignedSoftwareCertificate serverSoftwareCertificates,

-    SignatureData serverSignature,

-    UInt32 maxRequestMessageSize

-  }

-

-  type record ActivateSessionRequest {

-    RequestHeader requestHeader,

-    SignatureData clientSignature,

-    ListOfSignedSoftwareCertificate clientSoftwareCertificates,

-    ListOfLocaleId localeIds,

-    ExtensibleParameter userIdentityToken,

-    SignatureData userTokenSignature

-  }

-

-  type record ActivateSessionResponse {

-    ResponseHeader responseHeader,

-    ByteString serverNonce,

-    ListOfStatusCode results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record CloseSessionRequest {

-    RequestHeader requestHeader,

-    Boolean deleteSubscriptions

-  }

-

-  type record CloseSessionResponse {

-    ResponseHeader responseHeader

-  }

-

-  type record CancelRequestRequest {

-    RequestHeader requestHeader,

-    IntegerId requestHandle

-  }

-

-  type record CancelRequestResponse {

-    ResponseHeader responseHeader,

-    UInt32 cancelCount

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //              NodeManagement Service Sets                //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record AddNodesRequest {

-    RequestHeader requestHeader,

-    ListOfAddNodesItem nodesToAdd

-  }

-

-  type record AddNodesResponse {

-    ResponseHeader responseHeader,

-    ListOfAddNodesResult results

-  }

-

-  type record AddReferencesRequest {

-    RequestHeader requestHeader,

-    ListOfAddReferencesItem referencesToAdd

-  }

-

-  type record AddReferencesResponse {

-    ResponseHeader responseHeader,

-    ListOfStatusCode results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record DeleteNodesRequest {

-    RequestHeader requestHeader,

-    ListOfDeleteNodesItem nodesToDelete

-  }

-

-  type record DeleteNodesResponse {

-    ResponseHeader responseHeader,

-    ListOfStatusCode results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record DeleteReferencesRequest {

-    RequestHeader requestHeader,

-    ListOfDeleteReferencesItem referencesToDelete

-  }

-

-  type record DeleteReferencesResponse {

-    ResponseHeader responseHeader,

-    ListOfStatusCode results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                 Browse Service Sets                     //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record BrowseRequest {

-    RequestHeader requestHeader,

-    ViewDescription view,

-    Counter requestedMaxReferencesPerNode,

-    ListOfBrowseDescription nodesToBrowse

-  }

-

-  type record BrowseResponse {

-    ResponseHeader responseHeader,

-    ListOfBrowseResult results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record BrowseNextRequest {

-    RequestHeader requestHeader,

-    Boolean releaseContinuationPoints,

-    ListOfContinuationPoint continuationPoints

-  }

-

-  type record BrowseNextResponse {

-    ResponseHeader responseHeader,

-    ListOfBrowseResult results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record TranslateBrowsePathsToNodeIdsRequest {

-    RequestHeader requestHeader,

-    ListOfBrowsePath browsePaths

-  }

-

-  type record TranslateBrowsePathsToNodeIdsResponse {

-    ResponseHeader responseHeader,

-    ListOfBrowsePathResult results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record RegisterNodesRequest {

-    RequestHeader requestHeader,

-    ListOfNodeId nodesToRegister

-  }

-

-  type record RegisterNodesResponse {

-    ResponseHeader responseHeader,

-    ListOfNodeId registeredNodeIds

-  }

-

-  type record UnregisterNodesRequest {

-    RequestHeader requestHeader,

-    ListOfNodeId nodesToUnregister

-  }

-

-  type record UnregisterNodesResponse {

-    ResponseHeader responseHeader

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                 Query Service Set                       //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record QueryFirstRequest {

-    RequestHeader requestHeader,

-    ListOfNodeTypeDescription nodeTypes,

-    ContentFilter filter,

-    Counter maxDataSetsToReturn,

-    Counter maxReferencesToReturn

-  }

-

-  type record QueryFirstResponse {

-    ResponseHeader responseHeader,

-    ListOfQueryDataSet queryDataSets,

-    ContinuationPoint continuationPoint,

-    ListOfParsingResult parsingResults,

-    ListOfDiagnosticInfo diagnosticInfos,

-    ContentFilterResult filterResult

-  }

-

-  type record QueryNextRequest {

-    RequestHeader requestHeader,

-    Boolean releaseContinuationPoint,

-    ContinuationPoint continuationPoint

-  }

-

-  type record QueryNextResponse {

-    ResponseHeader responseHeader,

-    ListOfQueryDataSet queryDataSets,

-    ContinuationPoint revisedContinuationPoint

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                Attribute Service Set                    //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record ReadRequest {

-    RequestHeader requestHeader,

-    Duration maxAge,

-    TimestampsToReturn timestampsToReturn,

-    ListOfReadValueId nodesToRead

-  }

-

-  type record ReadResponse {

-    ResponseHeader responseHeader,

-    ListOfDataValue results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record HistoryReadRequest {

-    RequestHeader requestHeader,

-    ExtensibleParameter historyReadDetails,

-    TimestampsToReturn timestampsToReturn,

-    Boolean releaseContinuationPoints,

-    ListOfHistoryReadValueId nodesToRead

-  }

-

-  type record HistoryReadResponse {

-    ResponseHeader responseHeader,

-    ListOfHistoryReadResult results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record WriteRequest {

-    RequestHeader requestHeader,

-    ListOfWriteValue nodesToWrite

-  }

-

-  type record WriteResponse {

-    ResponseHeader responseHeader,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record HistoryUpdateRequest {

-    RequestHeader requestHeader,

-    ListOfExtensibleParameter historyUpdateDetails

-  }

-

-  type record HistoryUpdateResponse {

-    ResponseHeader responseHeader,

-    ListOfHistoryUpdateResult results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                   Method Service Set                    //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record CallRequest {

-    RequestHeader requestHeader,

-    ListOfCallMethodRequest methodsToCall

-  }

-

-  type record CallResponse {

-    ResponseHeader responseHeader,

-    ListOfCallMethodResult results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                MonitoredItem Service Set                //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record CreateMonitoredItemsRequest {

-    RequestHeader requestHeader,

-    IntegerId subscriptionId,

-    TimestampsToReturn timestampsToReturn,

-    ListOfMonitoredItemCreateRequest itemsToCreate

-  }

-

-  type record CreateMonitoredItemsResponse {

-    ResponseHeader responseHeader,

-    ListOfMonitoredItemCreateResult results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record ModifyMonitoredItemsRequest {

-    RequestHeader requestHeader,

-    IntegerId subscriptionId,

-    TimestampsToReturn timestampsToReturn,

-    ListOfMonitoredItemModifyRequest itemsToModify

-  }

-

-  type record ModifyMonitoredItemsResponse {

-    ResponseHeader responseHeader,

-    ListOfMonitoredItemModifyResult results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record SetMonitoringModeRequest {

-    RequestHeader requestHeader,

-    IntegerId subscriptionId,

-    MonitoringMode monitoringMode,

-    ListOfIntegerId monitoredItemIds

-  }

-

-  type record SetMonitoringModeResponse {

-    ResponseHeader responseHeader,

-    ListOfStatusCode results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record SetTriggeringRequest {

-    RequestHeader requestHeader,

-    IntegerId subscriptionId,

-    IntegerId triggeringItemId,

-    ListOfIntegerId linksToAdd,

-    IntegerId linksToRemove

-  }

-

-  type record SetTriggeringResponse {

-    ResponseHeader responseHeader,

-    ListOfStatusCode addResults,

-    ListOfDiagnosticInfo addDiagnosticInfos,

-    ListOfStatusCode removeResults,

-    ListOfDiagnosticInfo removeDiagnosticInfos

-  }

-

-  type record DeleteMonitoredItemsRequest {

-    RequestHeader requestHeader,

-    IntegerId subscriptionId,

-    ListOfIntegerId monitoredItemIds

-  }

-

-  type record DeleteMonitoredItemsResponse {

-    ResponseHeader responseHeader,

-    ListOfStatusCode results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                Subscription  Service Set                //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record CreateSubscriptionRequest {

-    RequestHeader requestHeader,

-    Duration requestedPublishingInterval,

-    Counter requestedLifetimeCount,

-    Counter requestedMaxKeepAliveCount,

-    Counter maxNotificationsPerPublish,

-    Boolean publishingEnabled,

-    Byte priorityInt32

-  }

-

-  type record CreateSubscriptionResponse {

-    ResponseHeader responseHeader,

-    IntegerId subscriptionId,

-    Duration revisedPublishingInterval,

-    Counter revisedLifetimeCount,

-    Counter revisedMaxKeepAliveCount

-  }

-

-  type record ModifySubscriptionRequest {

-    RequestHeader requestHeader,

-    IntegerId subscriptionId,

-    Duration requestedPublishingInterval,

-    Counter requestedLifetimeCount,

-    Counter requestedMaxKeepAliveCount,

-    Counter maxNotificationsPerPublish,

-    Byte priority

-  }

-

-  type record ModifySubscriptionResponse {

-    ResponseHeader responseHeader,

-    Duration revisedPublishingInterval,

-    Counter revisedLifetimeCount,

-    Counter revisedMaxKeepAliveCount

-  }

-

-  type record SetPublishingModeRequest {

-    RequestHeader requestHeader,

-    Boolean publishingEnabled,

-    ListOfIntegerId subscriptionIds

-  }

-

-  type record SetPublishingModeResponse {

-    ResponseHeader responseHeader,

-    ListOfStatusCode results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record PublishRequest {

-    RequestHeader requestHeader,

-    ListOfSubscriptionAcknowledgement subscriptionAcknowledgements

-  }

-

-  type record PublishResponse {

-    ResponseHeader responseHeader,

-    IntegerId subscriptionId,

-    ListOfCounter availableSequenceNumbers,

-    Boolean moreNotifications,

-    NotificationMessage notificationMessage,

-    //NotificationMessage notificationMessage, //!!

-    record of StatusCode results,

-    record of DiagnosticInfo diagnosticInfos

-  }

-

-  type record RepublishRequest {

-    RequestHeader requestHeader,

-    IntegerId subscriptionId,

-    Counter retransmitSequenceNumber

-  }

-

-  type record RepublishResponse {

-    ResponseHeader responseHeader,

-    NotificationMessage notificationMessage

-  }

-

-  type record TransferSubscriptionsRequest {

-    RequestHeader requestHeader,

-    ListOfIntegerId subscriptionIds,

-    Boolean sendInitialValues

-  }

-

-  type record TransferSubscriptionsResponse {

-    ResponseHeader responseHeader,

-    ListOfTransferResult results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  type record DeleteSubscriptionsRequest {

-    RequestHeader requestHeader,

-    ListOfIntegerId subscriptionIds

-  }

-

-  type record DeleteSubscriptionsResponse {

-    ResponseHeader responseHeader,

-    ListOfStatusCode results,

-    ListOfDiagnosticInfo diagnosticInfos

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                Session-less Service                     //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type record SessionlessInvokeRequest {

-    VersionTime urisVersion,

-    ListOfString namespaceUris,

-    ListOfString serverUris,

-    ListOfLocaleId localeIds,

-    UInt32 serviceId,

-    SessionlessServices body

-  }

-

-  type record SessionlessInvokeResponse {

-    ListOfString namespaceUris,

-    ListOfString serverUris,

-    UInt32 serviceId,

-    SessionlessServices body

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                     Main Types                          //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  type Int32 DataType;

-  type Variant BaseDataType;

-

-  type record of BaseDataType ListOfBaseDataType;

-

-  type union ServiceList {

-    //DiscoveryServices

-    FindServiceRequest FindServiceRequest,

-    FindServiceResponse FindServiceResponse,

-    FindServersOnNetworkRequest FindServersOnNetworkRequest,

-    FindServersOnNetworkResponse FindServersOnNetworkResponse,

-    GetEndpointsRequest GetEndpointsRequest,

-    GetEndpointsResponse GetEndpointsResponse,

-    RegisterServerRequest RegisterServerRequest,

-    RegisterServerResponse RegisterServerResponse,

-    RegisterServer2Request RegisterServer2Request,

-    RegisterServer2Response RegisterServer2Response,

-

-    //Secure Channel services

-    OpenSecureChannelRequest OpenSecureChannelRequest,

-    OpenSecureChannelResponse OpenSecureChannelResponse,

-    CloseSecureChannelRequest CloseSecureChannelRequest,

-    CloseSecureChannelResponse CloseSecureChannelResponse,

-

-    //Session Services

-    CreateSessionRequest CreateSessionRequest,

-    CreateSessionResponse CreateSessionResponse,

-    ActivateSessionRequest ActivateSessionRequest,

-    ActivateSessionResponse ActivateSessionResponse,

-    CloseSessionRequest CloseSessionRequest,

-    CloseSessionResponse CloseSessionResponse,

-    CancelRequestRequest CancelRequestRequest,

-    CancelRequestResponse CancelRequestResponse,

-

-    //Node Management Services

-    AddNodesRequest AddNodesRequest,

-    AddNodesResponse AddNodesResponse,

-    AddReferencesRequest AddReferencesRequest,

-    AddReferencesResponse AddReferencesResponse,

-    DeleteNodesRequest DeleteNodesRequest,

-    DeleteNodesResponse DeleteNodesResponse,

-    DeleteReferencesRequest DeleteReferencesRequest,

-    DeleteReferencesResponse DeleteReferencesResponse,

-

-    //View Services

-    BrowseRequest BrowseRequest,

-    BrowseResponse BrowseResponse,

-    BrowseNextRequest BrowseNextRequest,

-    BrowseNextResponse BrowseNextResponse,

-    TranslateBrowsePathsToNodeIdsRequest TranslateBrowsePathsToNodeIdsRequest,

-    TranslateBrowsePathsToNodeIdsResponse TranslateBrowsePathsToNodeIdsResponse,

-    RegisterNodesRequest RegisterNodesRequest,

-    RegisterNodesResponse RegisterNodesResponse,

-    UnregisterNodesRequest UnregisterNodesRequest,

-    UnregisterNodesResponse UnregisterNodesResponse,

-

-    //Query Services

-    QueryFirstRequest QueryFirstRequest,

-    QueryFirstResponse QueryFirstResponse,

-    QueryNextRequest QueryNextRequest,

-    QueryNextResponse QueryNextResponse,

-

-    //Attribute Services

-    ReadRequest ReadRequest,

-    ReadResponse ReadResponse,

-    HistoryReadRequest HistoryReadRequest,

-    HistoryReadResponse HistoryReadResponse,

-    WriteRequest WriteRequest,

-    WriteResponse WriteResponse,

-

-    //Method Services

-    HistoryUpdateRequest HistoryUpdateRequest,

-    HistoryUpdateResponse HistoryUpdateResponse,

-    CallRequest CallRequest,

-    CallResponse CallResponse,

-

-    //Monitored Item Services

-    CreateMonitoredItemsRequest CreateMonitoredItemsRequest,

-    CreateMonitoredItemsResponse CreateMonitoredItemsResponse,

-    ModifyMonitoredItemsRequest ModifyMonitoredItemsRequest,

-    ModifyMonitoredItemsResponse ModifyMonitoredItemsResponse,

-    SetMonitoringModeRequest SetMonitoringModeRequest,

-    SetMonitoringModeResponse SetMonitoringModeResponse,

-    SetTriggeringRequest SetTriggeringRequest,

-    SetTriggeringResponse SetTriggeringResponse,

-    DeleteMonitoredItemsRequest DeleteMonitoredItemsRequest,

-    DeleteMonitoredItemsResponse DeleteMonitoredItemsResponse,

-

-    //Subscription Services

-    CreateSubscriptionRequest CreateSubscriptionRequest,

-    CreateSubscriptionResponse CreateSubscriptionResponse,

-    ModifySubscriptionRequest ModifySubscriptionRequest,

-    ModifySubscriptionResponse ModifySubscriptionResponse,

-    SetPublishingModeRequest SetPublishingModeRequest,

-    SetPublishingModeResponse SetPublishingModeResponse,

-    PublishRequest PublishRequest,

-    PublishResponse PublishResponse,

-    RepublishRequest RepublishRequest,

-    RepublishResponse RepublishResponse,

-    TransferSubscriptionsRequest TransferSubscriptionsRequest,

-    TransferSubscriptionsResponse TransferSubscriptionsResponse,

-    DeleteSubscriptionsRequest DeleteSubscriptionsRequest,

-    DeleteSubscriptionsResponse DeleteSubscriptionsResponse

-  } with {

-    variant "";

-  }

-

-  type union SessionlessServices {

-    //Sessionless Invoke Services

-    //SessionlessInvokeRequest SessionlessInvokeRequest,

-    SessionlessInvokeResponse  SessionlessInvokeResponse,

-

-    ReadRequest readRequest,

-    ReadResponse readResponse,

-    WriteRequest writeRequest,

-    WriteResponse writeResponse,

-    CallRequest callRequest,

-    CallResponse callResponse

-  } with {

-    variant "";

-  }

-

-  type union OpcMessages {

-    HelloMessage helloMessage,

-    AckMessage ackMessage,

-    ErrorMessage errorMessage,

-    ReverseHelloMessage reverseHelloMessage

-  } with {

-    variant "";

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                    Encoded Types                        //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  //An OPC Message we recivie. Contains headers, and an encoded body.

-  //If the message is not a whole msg, you can chain the encoded body's together, and decode it when you have

-  //the full msg

-  type record MessageChunk {

-    MessageHeader header,

-    OpcMessages transportMessage optional,  //Transport Messages (Hello, Ack, ...)

-    UInt32 securityChannelId optional,  //OpenSecureChannel, CloseSecureChannel or Services

-    ListOfByte securePolicyUri optional,  //OpenSecureChannel

-    ListOfByte senderCertificate optional, //OpenSecureChannel

-    ListOfByte receiverCertificateThumbprint optional, //OpenSecureChannel

-    UInt32 securityTokenId optional, //Services or CloseSecureChannel

-    SequenceHeader sequenceHeader optional, //OpenSecureChannel, or Services

-    octetstring body optional //OpenSecureChannel, CloseSecureChannel or Services

-    //TODO: Add footer when security is implemented

-  } with {

-    variant (transportMessage) "PRESENCE(header.messageType = HelloHeaderMsgType,

-                                         header.messageType = AckHeaderMsgType,

-                                         header.messageType = ErrorHeaderMsgType,

-                                         header.messageType = ReverseHelloHeaderMsgType)"

-

-    variant (securityChannelId) "PRESENCE(header.messageType = ServicesMsgType,

-                                          header.messageType = CloseSecureChannelMsgType,

-                                          header.messageType = OpenSecureChannelMsgType)"

-

-    variant (securePolicyUri) "PRESENCE(header.messageType = OpenSecureChannelMsgType)"

-    variant (senderCertificate) "PRESENCE(header.messageType = OpenSecureChannelMsgType)"

-    variant (receiverCertificateThumbprint) "PRESENCE(header.messageType = OpenSecureChannelMsgType)"

-

-    variant (securityTokenId) "PRESENCE(header.messageType = ServicesMsgType,

-                                        header.messageType = CloseSecureChannelMsgType)"

-

-    variant (sequenceHeader) "PRESENCE(header.messageType = ServicesMsgType,

-                                          header.messageType = CloseSecureChannelMsgType,

-                                          header.messageType = OpenSecureChannelMsgType)"

-

-    variant (transportMessage)"CROSSTAG(helloMessage, header.messageType = HelloHeaderMsgType;

-                                        ackMessage, header.messageType = AckHeaderMsgType;

-                                        errorMessage, header.messageType = ErrorHeaderMsgType;

-                                        reverseHelloMessage, header.messageType = ReverseHelloHeaderMsgType)";

-

-    //TODO: Fix length encoding

-    variant (header) "LENGTHTO(header, transportMessage, securityChannelId, securePolicyUri, senderCertificate, receiverCertificateThumbprint, securityTokenId, sequenceHeader, body)"

-    variant (header) "LENGTHINDEX(messageSize)"

-  }

-

-  //The message body

-  type record ServiceBody {

-    Byte encodingByte,

-    Byte namespaceIndex,

-    UInt16 nodeValue,

-    ServiceList list

-  } with {

-    variant (list)"CROSSTAG( FindServiceRequest,  nodeValue = 0;     //No data in XML

-                             FindServiceResponse,  nodeValue = 1;    //No data in XML

-                             CloseSecureChannelRequest, nodeValue = 452;

-                             CloseSecureChannelResponse, nodeValue = 455;

-                             OpenSecureChannelRequest, nodeValue = 446;

-                             OpenSecureChannelResponse, nodeValue = 449;

-                             FindServersOnNetworkRequest,  nodeValue = 12208;

-                             FindServersOnNetworkResponse,  nodeValue = 12209;

-                             GetEndpointsRequest,  nodeValue = 428;

-                             GetEndpointsResponse,  nodeValue = 431;

-                             RegisterServerRequest,  nodeValue = 437;

-                             RegisterServerResponse,  nodeValue = 440;

-                             RegisterServer2Request,  nodeValue = 12211;

-                             RegisterServer2Response,  nodeValue = 12212;

-                             CreateSessionRequest,  nodeValue = 461;

-                             CreateSessionResponse,  nodeValue = 464;

-                             ActivateSessionRequest,  nodeValue = 467;

-                             ActivateSessionResponse,  nodeValue = 470;

-                             CloseSessionRequest,  nodeValue = 473;

-                             CloseSessionResponse,  nodeValue = 476;

-                             CancelRequestRequest,  nodeValue = 479;

-                             CancelRequestResponse,  nodeValue = 482;

-                             AddNodesRequest,  nodeValue = 488;

-                             AddNodesResponse,  nodeValue = 491;

-                             AddReferencesRequest,  nodeValue = 494;

-                             AddReferencesResponse,  nodeValue = 497;

-                             DeleteNodesRequest,  nodeValue = 500;

-                             DeleteNodesResponse,  nodeValue = 503;

-                             DeleteReferencesRequest,  nodeValue = 506;

-                             DeleteReferencesResponse,  nodeValue = 509;

-                             BrowseRequest,  nodeValue = 527;

-                             BrowseResponse,  nodeValue = 530;

-                             BrowseNextRequest,  nodeValue = 533;

-                             BrowseNextResponse,  nodeValue = 536;

-                             TranslateBrowsePathsToNodeIdsRequest,  nodeValue = 554;

-                             TranslateBrowsePathsToNodeIdsResponse,  nodeValue = 557;

-                             RegisterNodesRequest,  nodeValue = 560;

-                             RegisterNodesResponse,  nodeValue = 563;

-                             UnregisterNodesRequest,  nodeValue = 566;

-                             UnregisterNodesResponse,  nodeValue = 569;

-                             QueryFirstRequest,  nodeValue = 615;

-                             QueryFirstResponse,  nodeValue = 618;

-                             QueryNextRequest,  nodeValue = 621;

-                             QueryNextResponse,  nodeValue = 624;

-                             ReadRequest,  nodeValue = 631;

-                             ReadResponse,  nodeValue = 634;

-                             HistoryReadRequest,  nodeValue = 664;

-                             HistoryReadResponse,  nodeValue = 667;

-                             WriteRequest,  nodeValue = 673;

-                             WriteResponse,  nodeValue = 677;

-                             HistoryUpdateRequest,  nodeValue = 700;

-                             HistoryUpdateResponse,  nodeValue = 703;

-                             CallRequest,  nodeValue = 712;

-                             CallResponse,  nodeValue = 715;

-                             CreateMonitoredItemsRequest,  nodeValue = 751;

-                             CreateMonitoredItemsResponse,  nodeValue = 754;

-                             ModifyMonitoredItemsRequest,  nodeValue = 763;

-                             ModifyMonitoredItemsResponse,  nodeValue = 766;

-                             SetMonitoringModeRequest,  nodeValue = 769;

-                             SetMonitoringModeResponse,  nodeValue = 772;

-                             SetTriggeringRequest,  nodeValue = 775;

-                             SetTriggeringResponse,  nodeValue = 778;

-                             DeleteMonitoredItemsRequest,  nodeValue = 781;

-                             DeleteMonitoredItemsResponse,  nodeValue = 784;

-                             CreateSubscriptionRequest,  nodeValue = 787;

-                             CreateSubscriptionResponse,  nodeValue = 790;

-                             ModifySubscriptionRequest,  nodeValue = 793;

-                             ModifySubscriptionResponse,  nodeValue = 796;

-                             SetPublishingModeRequest,  nodeValue = 799;

-                             SetPublishingModeResponse,  nodeValue = 802;

-                             PublishRequest,  nodeValue = 826;

-                             PublishResponse,  nodeValue = 829;

-                             RepublishRequest,  nodeValue = 832;

-                             RepublishResponse,  nodeValue = 835;

-                             TransferSubscriptionsRequest,  nodeValue = 841;

-                             TransferSubscriptionsResponse,  nodeValue = 844;

-                             DeleteSubscriptionsRequest,  nodeValue = 847;

-                             DeleteSubscriptionsResponse,  nodeValue = 850)";

-  }

-

-} with { encode "RAW" }

+/////////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2017-2018  Ericsson AB
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+/////////////////////////////////////////////////////////////////////////////////////
+// Contributors:
+// Akos Makovics
+//
+//  File:         UpcUa_Types_Binary.ttcn
+//  Rev:          <RnXnn>
+//  Prodnr:       CNL113861
+/////////////////////////////////////////////////////////////////////////////////////
+
+module OpcUa_Types_Binary
+{
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Encoders and Decoders                   //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  external function enc_MessageChunk (in MessageChunk msg) return octetstring
+    with { extension "prototype(convert) encode(RAW)" }
+
+  external function dec_MessageChunk (in octetstring p_oct, out MessageChunk msg) return integer
+    with {extension "prototype(backtrack) decode (RAW) errorbehavior(ALL:WARNING)"}
+
+  external function enc_ServiceBody (in ServiceBody msg) return octetstring
+    with { extension "prototype(convert) encode(RAW)" }
+
+  external function dec_ServiceBody (in octetstring p_oct, out ServiceBody msg) return integer
+    with {extension "prototype(backtrack) decode (RAW) errorbehavior(ALL:WARNING)"}
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                     Constant Values                     //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  const integer Null_Value := -2147483647;
+
+  const integer HelloHeaderMsgType := 4998472;
+  const integer AckHeaderMsgType := 4932417;
+  const integer ErrorHeaderMsgType := 5395013;
+  const integer ReverseHelloHeaderMsgType := 4540498;
+
+  const integer OpenSecureChannelMsgType := 5132367;
+  const integer CloseSecureChannelMsgType := 5196867;
+  const integer ServicesMsgType := 4674381;
+
+  const integer FinalChunk := 70;
+  const integer IntermediateChunk := 67;
+  const integer ErrorChunk := 65;
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                     Enumerations                        //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type enumerated MessageSecurityMode {
+    INVALID_0,
+    NONE_1,
+    SIGN_2,
+    SIGNANDENCRYPT_3
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated SecurityTokenRequestType {
+    ISSUE_0,
+    RENEW_1
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated NodeClass
+  {
+    UNSPECIFIED_0(0),
+    OBJECT_1(1),
+    VARIABLE_2(2),
+    METHOD_4(4),
+    OBJECT_TYPE_8(8),
+    VARIABLE_TYPE_16(16),
+    REFERENCE_TYPE_32(32),
+    DATA_TYPE_64(64),
+    VIEW_128(128)
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated StructureType {
+    STRUCTURE_0,
+    STRUCTURE_WITH_OPTIONAL_FIELDS_1,
+    UNION_2
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated ApplicationType {
+    SERVER_0,
+    CLIENT_1,
+    CLIENTANDSERVER_2,
+    DISCOVERYSERVER_3
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated DataChangeTrigger {
+    STATUS_0,
+    STATUS_VALUE_1,
+    STATUS_VALUE_TIMESTAMP_2
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated MonitoringMode {
+    DISABLED_0,
+    SAMPLING_1,
+    REPORTING_2
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated BrowseDirection {
+    FORWARD_0,
+    INVERSE_1,
+    BOTH_2
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated TimestampsToReturn {
+    SOURCE_0,
+    SERVER_1,
+    BOTH_2,
+    NEITHER_3
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated UserIdentityTokenType {
+    ANONYMOUS_0,
+    USERNAME_1,
+    CERTIFICATE_2,
+    ISSUEDTOKEN_3
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated PerformUpdateType {
+    INSERT_1(1),
+    REPLACE_2(2),
+    UPDATE_3(3)
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated PerformUpdateTypeExtended {
+    INSERT_1(1),
+    REPLACE_2(2),
+    UPDATE_3(3),
+    REMOVE_4(4)
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated IdType
+  {
+    NUMERIC_0,
+    STRING_1,
+    GUID_2,
+    OPAQUE_3
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated FilterOperator {
+    Equals_0,
+    IsNull_1,
+    GreaterThan_2,
+    LessThan_3,
+    GreaterThanOrEqual_4,
+    LessThanOrEqual_5,
+    Like_6,
+    Not_7,
+    Between_8,
+    InList_9,
+    And_10,
+    Or_11,
+    Cast_12,
+    InView_13,
+    OfType_14,
+    RelatedTo_15,
+    BitwiseAnd_16,
+    BitwiseOr_17
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated OpenFileMode
+  {
+    READ_1(1),
+    WRITE_2(2),
+    ERASE_EXISTING_4(4),
+    APPEND_8(8)
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  type enumerated TrustListMasks
+  {
+    none_0(0),
+    trustedCertificates_1(1),
+    trustedCrls_2(2),
+    issuerCertificates_4(4),
+    issuerCrls_8(8),
+    all_15(15)
+  } with {
+    variant "FIELDLENGTH(32)"
+    variant "COMP(signbit)"
+    variant "BYTEORDER(first)"
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                      Base Types                         //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  //Value 0 is false, any other value is true. Encoder must use value 1 as true
+  type Byte Boolean;
+
+  //An integer value between 0 and 1
+  type integer Bit with { variant "FIELDLENGTH(1), COMP(nosign), BYTEORDER(first)" };
+
+  //An integer value between 0 and 15
+  type integer Bit4 with { variant "FIELDLENGTH(4), COMP(nosign), BYTEORDER(first)" };
+
+  //An integer value between 0 and 63
+  type integer Bit6 with { variant "FIELDLENGTH(6), COMP(nosign), BYTEORDER(first)" };
+
+  //An integer value between -128 and 127 inclusive.
+  type integer SByte with { variant "FIELDLENGTH(8), COMP(signbit), BYTEORDER(first)" };
+
+  //An integer value between 0 and 255 inclusive.
+  type integer Byte with { variant "FIELDLENGTH(8), COMP(nosign), BYTEORDER(first)" };
+
+  //An integer value between -32 768 and 32 767 inclusive.
+  type integer Int16 with { variant "FIELDLENGTH(16), COMP(signbit), BYTEORDER(first)" };
+
+  //An integer value between 0 and 65 535 inclusive.
+  type integer UInt16 with { variant "FIELDLENGTH(16), COMP(nosign), BYTEORDER(first)" };
+
+  //An integer value between 0 and 16 777 215
+  type integer UInt24 with { variant "FIELDLENGTH(24), COMP(nosign), BYTEORDER(first)" }
+
+  //An integer value between -2 147 483 648 and 2 147 483 647 inclusive.
+  type integer Int32 with { variant "FIELDLENGTH(32), COMP(signbit), BYTEORDER(first)" };
+
+  //An integer value between 0 and 4 294 967 295 inclusive.
+  type integer UInt32 with { variant "FIELDLENGTH(32), COMP(nosign), BYTEORDER(first)" };
+
+  //An integer value between -9 223 372 036 854 775 808 and 9 223 372 036 854 775 807 inclusive.
+  type integer Int64 with { variant "FIELDLENGTH(64), COMP(signbit), BYTEORDER(first)" };
+
+  //An integer value between 0 and 18 446 744 073 709 551 615 inclusive.
+  type integer UInt64 with { variant "FIELDLENGTH(64), COMP(nosign), BYTEORDER(first)" };
+
+  //An IEEE single precision (32 bit) floating point value.
+  type float Float with { variant "FORMAT(IEEE754 float), FIELDLENGTH(32), BYTEORDER(last)"};
+
+  //An IEEE double precision (64 bit) floating point value.
+  type float Double with { variant "FORMAT(IEEE754 double), FIELDLENGTH(64), BYTEORDER(last)"};
+
+  //Defines an interval of time in milliseconds
+  type float Duration with { variant "FORMAT(IEEE754 double), BYTEORDER(last)"};
+
+  //Number of 100 nanosecond intervals since January 1, 1601
+  type integer DateTime with { variant "FIELDLENGTH(64), COMP(signbit), BYTEORDER(first)"};
+
+  //Define Coordinated Universal Time (UTC) values.
+  type DateTime UtcTime;
+
+  //Represents the time in seconds since the year 2000. It is used as version number based on the last change time.
+  type UInt32 VersionTime;
+
+  //Represents the value of a counter
+  type UInt32 Counter;
+
+  //Identifies an element of an array
+  type UInt32 Index;
+
+  //Used as an identifier, such as a handle. All values, except for 0, are valid.
+  type UInt32 IntegerId;
+
+  //Representing an image.
+  type octetstring Image;
+
+  //Representing an image in BMP format.
+  type octetstring ImageBMP;
+
+  //Representing an image in GIF format.
+  type octetstring ImageGIF;
+
+  //Representing an image in JPG format.
+  type octetstring ImageJPG;
+
+  //Representing an image in PNG format.
+  type octetstring ImagePNG;
+
+  //Representing audio data. It can be any number of audio formats.
+  type ByteString AudioData;
+
+  //A string that is composed of a language component and a country/region component
+  type String LocaleId;
+
+  //Used to pause a Browse or QueryFirst operation
+  type ByteString ContinuationPoint;
+
+  //Used for indexing a range within an array
+  type String NumericRange;
+
+  //An opaque identifier that is used to identify requests associated with a particular Session.
+  type NodeId SessionAuthenticationToken;
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                   Complex Types                         //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  //Sequence of UTF-8 characters without a null terminator and preceded by the length in bytes.
+  //A length of -1 is used to indicate a null string
+  type union String {
+    NullArray nullString,
+    NonNullString realString
+  }
+
+  //A 16-byte value that can be used as a globally unique identifier.
+  type record Guid {
+    UInt32 data1,
+    UInt16 data2,
+    UInt16 data3,
+    Byte data41,
+    Byte data42,
+    Byte data43,
+    Byte data44,
+    Byte data45,
+    Byte data46,
+    Byte data47,
+    Byte data48
+  };
+
+  //Sequence of bytes preceded by its length in bytes
+  type union ByteString {
+    NullArray nullByteString,
+    RealByteString realByteString
+  }
+
+  //An XML element, as an XML fragment serialized as UTF-8 string
+  type ByteString XmlElement;
+
+  //An identifier for a node in the address space of an OPC UA Server.
+  type record NodeId {
+    Bit4 mask,
+    Bit namespaceUriBit,
+    Bit serverIndexBit,
+    Bit reservedBit1,
+    Bit reservedBit2,
+    NodeIdType IdType
+  } with {
+    variant (IdType)"CROSSTAG( twoByte, mask = 0;
+                               fourByte, mask = 1;
+                               numeric, mask = 2;
+                               string, mask = 3;
+                               guid, mask = 4;
+                               byteString, mask = 5)";
+  }
+
+  //Helper type, contains the possible body types for NodeId
+  type union NodeIdType {
+    TwoByteNodeId twoByte,
+    FourByteNodeId fourByte,
+    NumericNodeId numeric,
+    StringNodeId string,
+    GuidNodeId guid,
+    ByteStringNodeId byteString
+  }
+
+  //The body of a two byte node id
+  type record TwoByteNodeId {
+    Byte nodeValue
+  }
+
+  //The body of a four byte node id
+  type record FourByteNodeId {
+    Byte nameSpace,
+    UInt16 nodeValue
+  }
+
+  //The body of a numeric node id
+  type record NumericNodeId {
+    Byte nameSpace,
+    UInt32 nodeValue
+  }
+
+  //The body of a string node id
+  type record StringNodeId {
+    UInt16 nameSpace,
+    String nodeValue
+  }
+
+  //The body of a guid node id
+  type record GuidNodeId {
+    UInt16 nameSpace,
+    Guid nodeValue
+  }
+
+  //The body of a byte string node id
+  type record ByteStringNodeId {
+    UInt16 nameSpace,
+    ByteString nodeValue
+  }
+
+  //Extends the NodeId structure by allowing the NamespaceUri to be explicitly specified instead of using the NamespaceIndex.
+  type record ExpandedNodeId {
+    NodeId node,
+    String namespaceUri optional, //not present if null or empty
+    UInt32 serverIndex optional //not present if null
+  }with {
+    variant (namespaceUri) "PRESENCE(node.namespaceUriBit = 1)"
+    variant (serverIndex) "PRESENCE(node.serverIndexBit = 1)"
+  }
+
+  //Implementation of the Extension Object for the Extensible Parameter types
+  type record ExtensibleParameter {
+    Byte encodingByte,
+    Byte twoByteNodeValue optional,
+    Byte namespaceIndex optional,
+    UInt16 fourByteNodeValue optional,
+
+    Byte encoding,
+    Int32 parameterLength optional,
+    ExtensibleParameterBody extensibleParameterBody optional
+  } with {
+
+    variant (twoByteNodeValue)"PRESENCE( encodingByte = 0)";
+    variant (namespaceIndex)"PRESENCE( encodingByte = 1)";
+    variant (fourByteNodeValue)"PRESENCE( encodingByte = 1)";
+
+    variant (parameterLength) "PRESENCE( twoByteNodeValue = 594, fourByteNodeValue = 594,
+                                         twoByteNodeValue = 597, fourByteNodeValue = 597,
+                                         twoByteNodeValue = 600, fourByteNodeValue = 600,
+                                         twoByteNodeValue = 603, fourByteNodeValue = 603,
+                                         twoByteNodeValue = 724, fourByteNodeValue = 724,
+                                         twoByteNodeValue = 727, fourByteNodeValue = 727,
+                                         twoByteNodeValue = 730, fourByteNodeValue = 730,
+                                         twoByteNodeValue = 736, fourByteNodeValue = 736,
+                                         twoByteNodeValue = 739, fourByteNodeValue = 739,
+                                         twoByteNodeValue = 354, fourByteNodeValue = 354,
+                                         twoByteNodeValue = 357, fourByteNodeValue = 357,
+                                         twoByteNodeValue = 360, fourByteNodeValue = 360,
+                                         twoByteNodeValue = 363, fourByteNodeValue = 363,
+                                         twoByteNodeValue = 366, fourByteNodeValue = 366,
+                                         twoByteNodeValue = 369, fourByteNodeValue = 369,
+                                         twoByteNodeValue = 372, fourByteNodeValue = 372,
+                                         twoByteNodeValue = 375, fourByteNodeValue = 375,
+                                         twoByteNodeValue = 1, fourByteNodeValue = 1,
+                                         twoByteNodeValue = 321, fourByteNodeValue = 321,
+                                         twoByteNodeValue = 324, fourByteNodeValue = 324,
+                                         twoByteNodeValue = 327, fourByteNodeValue = 327,
+                                         twoByteNodeValue = 940, fourByteNodeValue = 940,
+                                         twoByteNodeValue = 12901, fourByteNodeValue = 12901,
+                                         twoByteNodeValue = 646, fourByteNodeValue = 646,
+                                         twoByteNodeValue = 649, fourByteNodeValue = 649,
+                                         twoByteNodeValue = 652, fourByteNodeValue = 652,
+                                         twoByteNodeValue = 655, fourByteNodeValue = 655,
+                                         twoByteNodeValue = 658, fourByteNodeValue = 658,
+                                         twoByteNodeValue = 682, fourByteNodeValue = 682,
+                                         twoByteNodeValue = 11300, fourByteNodeValue = 11300,
+                                         twoByteNodeValue = 685, fourByteNodeValue = 685,
+                                         twoByteNodeValue = 688, fourByteNodeValue = 688,
+                                         twoByteNodeValue = 691, fourByteNodeValue = 691,
+                                         twoByteNodeValue = 694, fourByteNodeValue = 694,
+                                         twoByteNodeValue = 811, fourByteNodeValue = 811,
+                                         twoByteNodeValue = 916, fourByteNodeValue = 916,
+                                         twoByteNodeValue = 820, fourByteNodeValue = 820)"
+
+    variant (extensibleParameterBody) "CROSSTAG( elementOperand,  {twoByteNodeValue = 594, fourByteNodeValue = 594};
+                                                 literalOperand,  {twoByteNodeValue = 597, fourByteNodeValue = 597};
+                                                 attributeOperand,  {twoByteNodeValue = 600, fourByteNodeValue = 600};
+                                                 simpleAttributeOperand,  {twoByteNodeValue = 603, fourByteNodeValue = 603};
+                                                 dataChangeFilter, {twoByteNodeValue = 724, fourByteNodeValue = 724};
+                                                 eventFilter, {twoByteNodeValue = 727, fourByteNodeValue = 727};
+                                                 aggregateFilter, {twoByteNodeValue = 730, fourByteNodeValue = 730};
+                                                 eventFilterResult,  {twoByteNodeValue = 736, fourByteNodeValue = 736};
+                                                 aggregateFilterResult,  {twoByteNodeValue = 739, fourByteNodeValue = 739};
+                                                 objectAttributes,  {twoByteNodeValue = 354, fourByteNodeValue = 354};
+                                                 variableAttributes,  {twoByteNodeValue = 357, fourByteNodeValue = 357};
+                                                 methodAttributes,  {twoByteNodeValue = 360, fourByteNodeValue = 360};
+                                                 objectTypeAttributes,  {twoByteNodeValue = 363, fourByteNodeValue = 363};
+                                                 variableTypeAttributes,  {twoByteNodeValue = 366, fourByteNodeValue = 366};
+                                                 referenceTypeAttributes,  {twoByteNodeValue = 369, fourByteNodeValue = 369};
+                                                 dataTypeAttributes,  {twoByteNodeValue = 372, fourByteNodeValue = 372};
+                                                 viewAttributes,  {twoByteNodeValue = 375, fourByteNodeValue = 375};
+                                                 genericAttributes,  {twoByteNodeValue = 1, fourByteNodeValue = 1};
+                                                 anonymousIdentityToken,  {twoByteNodeValue = 321, fourByteNodeValue = 321};
+                                                 userNameIdentityToken,  {twoByteNodeValue = 324, fourByteNodeValue = 324};
+                                                 x509IdentityToken,  {twoByteNodeValue = 327, fourByteNodeValue = 327};
+                                                 issuedIdentityToken,  {twoByteNodeValue = 940, fourByteNodeValue = 940};
+                                                 mdnsDiscoveryConfiguration, {twoByteNodeValue = 12901, fourByteNodeValue = 12901};
+                                                 readEventDetails,  {twoByteNodeValue = 646, fourByteNodeValue = 646};
+                                                 readRawModifiedDetails,  {twoByteNodeValue = 649, fourByteNodeValue = 649};
+                                                 readProcessedDetails,  {twoByteNodeValue = 652, fourByteNodeValue = 652};
+                                                 readAtTimeDetails,  {twoByteNodeValue = 655, fourByteNodeValue = 655};
+                                                 dataValues,  {twoByteNodeValue = 658, fourByteNodeValue = 658};
+                                                 updateDataDetails,  {twoByteNodeValue = 682, fourByteNodeValue = 682};
+                                                 updateStructureDataDetails,  {twoByteNodeValue = 11300, fourByteNodeValue = 11300};
+                                                 updateEventDetails,  {twoByteNodeValue = 685, fourByteNodeValue = 685};
+                                                 deleteRawModifiedDetails,  {twoByteNodeValue = 688, fourByteNodeValue = 688};
+                                                 deleteAtTimeDetails,  {twoByteNodeValue = 691, fourByteNodeValue = 691};
+                                                 deleteEventDetails,  {twoByteNodeValue = 694, fourByteNodeValue = 694};
+                                                 dataChangeNotification,  {twoByteNodeValue = 811, fourByteNodeValue = 811};
+                                                 eventNotificationList,  {twoByteNodeValue = 916, fourByteNodeValue = 916};
+                                                 statusChangeNotification,  {twoByteNodeValue = 820, fourByteNodeValue = 820})"
+  }
+
+  //Possible extension types
+  type union ExtensibleParameterBody {
+    ElementOperand elementOperand,
+    LiteralOperand literalOperand,
+    AttributeOperand attributeOperand,
+    SimpleAttributeOperand simpleAttributeOperand,
+    DataChangeFilter dataChangeFilter,
+    EventFilter eventFilter,
+    AggregateFilter aggregateFilter,
+    EventFilterResult eventFilterResult,
+    AggregateFilterResult aggregateFilterResult,
+    ObjectAttributes objectAttributes,
+    VariableAttributes variableAttributes,
+    MethodAttributes methodAttributes,
+    ObjectTypeAttributes objectTypeAttributes,
+    VariableTypeAttributes variableTypeAttributes,
+    ReferenceTypeAttributes referenceTypeAttributes,
+    DataTypeAttributes dataTypeAttributes,
+    ViewAttributes viewAttributes,
+    GenericAttributes genericAttributes,
+    UserNameIdentityToken userNameIdentityToken,
+    X509IdentityToken x509IdentityToken,
+    IssuedIdentityToken issuedIdentityToken,
+    AnonymousIdentityToken anonymousIdentityToken,
+    MdnsDiscoveryConfiguration mdnsDiscoveryConfiguration,
+    ReadEventDetails readEventDetails,
+    ReadRawModifiedDetails readRawModifiedDetails,
+    ReadProcessedDetails readProcessedDetails,
+    ReadAtTimeDetails readAtTimeDetails,
+    ListOfDataValue dataValues,
+    UpdateDataDetails updateDataDetails,
+    UpdateStructureDataDetails updateStructureDataDetails,
+    UpdateEventDetails updateEventDetails,
+    DeleteRawModifiedDetails deleteRawModifiedDetails,
+    DeleteAtTimeDetails deleteAtTimeDetails,
+    DeleteEventDetails deleteEventDetails,
+    DataChangeNotification dataChangeNotification,
+    EventNotificationList eventNotificationList,
+    StatusChangeNotification statusChangeNotification
+  }
+
+  //A numeric identifier for an error or condition that is associated with a value or an operation.
+  type UInt32 StatusCode;
+
+  //A structure that contains detailed error and diagnostic information associated with a StatusCode.
+  type record DiagnosticInfo {
+    Bit symbolicIdBit,
+    Bit namespaceUriBit,
+    Bit localeBit,
+    Bit localisedTextBit,
+    Bit additionalInfoBit,
+    Bit innerStatusCodeBit,
+    Bit innerDiagnosticInfoBit,
+    Bit reserveBit,
+    Int32 symbolicId optional,
+    Int32 namespaceUri optional,
+    Int32 locale optional,
+    Int32 localisedText optional,
+    String additionalInfo optional,
+    StatusCode innerStatusCode optional,
+    DiagnosticInfo innerDiagnosticInfo optional
+  }with {
+    variant (symbolicId) "PRESENCE(symbolicIdBit = 1)";
+    variant (namespaceUri) "PRESENCE(namespaceUriBit = 1)";
+    variant (locale) "PRESENCE(localeBit = 1)";
+    variant (localisedText) "PRESENCE(localisedTextBit = 1)";
+    variant (additionalInfo) "PRESENCE(additionalInfoBit = 1)";
+    variant (innerStatusCode) "PRESENCE(innerStatusCodeBit = 1)";
+    variant (innerDiagnosticInfo) "PRESENCE(innerDiagnosticInfoBit = 1)";
+  }
+
+  //A name qualified by a namespace.
+  type record QualifiedName {
+    UInt16 namespaceIndex,
+    String name
+  }
+
+  //Human readable text with an optional locale identifier.
+  type record LocalizedText {
+    Bit localeBit,
+    Bit textBit,
+    Bit spareBit1,
+    Bit spareBit2,
+    Bit spareBit3,
+    Bit spareBit4,
+    Bit spareBit5,
+    Bit spareBit6,
+    String locale optional,
+    String text optional
+  } with {
+    variant (locale) "PRESENCE(localeBit = 1)";
+    variant (text) "PRESENCE(textBit = 1)";
+  }
+
+  //A structure that contains an application specific data type that may not be recognized by the receiver
+  type record ExtensionObject {
+    NodeId typeId,
+    Byte encoding,
+    Int32 Length,
+    ExtensionObjectBody body optional
+  } with {
+    variant (body)"CROSSTAG( byteString,  encoding = 1;
+                             xmlElement, encoding = 2)";
+  }
+
+  type union ExtensionObjectBody {
+    ListOfByte byteString,
+    octetstring xmlElement
+  }
+
+  //A union of all of the types specified above.
+  type record Variant {
+    Bit6 encodingBits,
+    Bit arrayDimensionsBit,
+    Bit arrayEncodedBit,
+    Int32 arrayLength optional,
+    VariantSingleValue ValueSingle optional,
+    VariantArrayValue ValueArray optional,
+    Int32 arrayDimensionsLenght optional,
+    ListOfInt32 arrayDimensions optional
+  } with {
+    variant (arrayDimensions) "PRESENCE(arrayDimensionsBit = 1)";
+    variant (arrayDimensionsLenght) "PRESENCE(arrayDimensionsBit = 1)";
+    variant (arrayLength) "PRESENCE(arrayDimensionsBit = 1)";
+
+    variant (ValueSingle) "PRESENCE(arrayEncodedBit = 0)"
+    variant (ValueArray) "PRESENCE(arrayEncodedBit = 1)"
+
+    variant (ValueSingle)"CROSSTAG( bool, encodingBits = 1;
+                                    sbyte, encodingBits = 2;
+                                    byte, encodingBits = 3;
+                                    int16, encodingBits = 4;
+                                    uint16, encodingBits = 5;
+                                    int32, encodingBits = 6;
+                                    uint32, encodingBits = 7;
+                                    int64, encodingBits = 8;
+                                    uint64, encodingBits = 9;
+                                    floatValue, encodingBits = 10;
+                                    double, encodingBits = 11;
+                                    string, encodingBits = 12;
+                                    datetime, encodingBits = 13;
+                                    guid, encodingBits = 14;
+                                    bytestring, encodingBits = 15;
+                                    xmlelement, encodingBits = 16;
+                                    nodeid, encodingBits = 17;
+                                    expandednodeid, encodingBits = 18;
+                                    statuscode, encodingBits = 19;
+                                    qualifiedname, encodingBits = 20;
+                                    localizedtext, encodingBits = 21;
+                                    extensionobject, encodingBits = 22;
+                                    datavalue, encodingBits = 23;
+                                    listofvariant, encodingBits = 24;
+                                    diagnosticinfo, encodingBits = 25)";
+
+    variant (ValueArray)"CROSSTAG( bool, encodingBits = 1;
+                                   sbyte, encodingBits = 2;
+                                   byte, encodingBits = 3;
+                                   int16, encodingBits = 4;
+                                   uint16, encodingBits = 5;
+                                   int32, encodingBits = 6;
+                                   uint32, encodingBits = 7;
+                                   int64, encodingBits = 8;
+                                   uint64, encodingBits = 9;
+                                   floatValue, encodingBits = 10;
+                                   double, encodingBits = 11;
+                                   string, encodingBits = 12;
+                                   datetime, encodingBits = 13;
+                                   guid, encodingBits = 14;
+                                   bytestring, encodingBits = 15;
+                                   xmlelement, encodingBits = 16;
+                                   nodeid, encodingBits = 17;
+                                   expandednodeid, encodingBits = 18;
+                                   statuscode, encodingBits = 19;
+                                   qualifiedname, encodingBits = 20;
+                                   localizedtext, encodingBits = 21;
+                                   extensionobject, encodingBits = 22;
+                                   datavalue, encodingBits = 23;
+                                   listofvariant, encodingBits = 24;
+                                   diagnosticinfo, encodingBits = 25)";
+  }
+
+  //An union of single values for Variant
+  type union VariantSingleValue {
+    Boolean bool,
+    SByte sbyte,
+    Byte byte,
+    Int16 int16,
+    UInt16 uint16,
+    Int32 int32,
+    UInt32 uint32,
+    Int64 int64,
+    UInt64 uint64,
+    Float floatValue,
+    Double double,
+    String string,
+    DateTime datetime,
+    Guid guid,
+    ByteString bytestring,
+    XmlElement xmlelement,
+    NodeId nodeid,
+    ExpandedNodeId expandednodeid,
+    StatusCode statuscode,
+    QualifiedName qualifiedname,
+    LocalizedText localizedtext,
+    ExtensionObject extensionobject,
+    DataValue datavalue,
+    ListOfVariant listofvariant,
+    DiagnosticInfo diagnosticinfo
+  }
+
+  //An union of arrays for Variant
+  type union VariantArrayValue {
+    ListOfBoolean bool,
+    ListOfSByte sbyte,
+    ListOfByte byte,
+    ListOfInt16 int16,
+    ListOfUInt16 uint16,
+    ListOfInt32 int32,
+    ListOfUInt32 uint32,
+    ListOfInt64 int64,
+    ListOfUInt64 uint64,
+    ListOfFloat floatValue,
+    ListOfDouble double,
+    ListOfString string,
+    ListOfDateTime datetime,
+    ListOfGuid guid,
+    ListOfByteString bytestring,
+    ListOfXmlElement xmlelement,
+    ListOfNodeId nodeid,
+    ListOfExpandedNodeId expandednodeid,
+    ListOfStatusCode statuscode,
+    ListOfQualifiedName qualifiedname,
+    ListOfLocalizedText localizedtext,
+    ListOfExtensionObject extensionobject,
+    ListOfDataValue datavalue,
+    ListOfVariant listofvariant,
+    ListOfDiagnosticInfo diagnosticinfo
+  }
+
+  //A data value with an associated status code and timestamps.
+  type record DataValue {
+    Bit ValueBit,
+    Bit statusBit,
+    Bit sourceTimestampBit,
+    Bit serverTimestampBit,
+    Bit sourcePicoSecondsBit,
+    Bit serverPicoSecondsBit,
+    Bit spareBit1,
+    Bit spareBit2,
+    Variant Value optional,
+    StatusCode status optional,
+    DateTime sourceTimestamp optional,
+    UInt16 sourcePicoSeconds optional,
+    DateTime serverTimestamp optional,
+    UInt16 serverPicoSeconds optional
+  } with {
+    variant (Value) "PRESENCE(ValueBit = 1)";
+    variant (status) "PRESENCE(statusBit = 1)";
+    variant (sourceTimestamp) "PRESENCE(sourceTimestampBit = 1)";
+    variant (sourcePicoSeconds) "PRESENCE(sourcePicoSecondsBit = 1)";
+    variant (serverTimestamp) "PRESENCE(serverTimestampBit = 1)";
+    variant (serverPicoSeconds) "PRESENCE(serverPicoSecondsBit = 1)";
+  }
+
+  //A high-precision signed decimal number
+  type record Decimal {
+    NodeId typeId,
+    Byte decimalLength,
+    Int16 scale,
+    Byte decimalValue
+  }
+
+  //Structured DataType defines the local time that may or may not take daylight saving time into account.
+  type record TimeZoneDataType {
+    Int16 offset,
+    Boolean daylightSavingInOffset
+  }
+
+  //Defines a Method input or output argument specification.
+  type record Argument {
+    String name,
+    NodeId dataType,
+    Int32 valueRank,
+    ListOfUInt32 arrayDimensions,
+    LocalizedText description
+  }
+
+  //Represent a human-readable representation of an Enumeration.
+  type record EnumValueType {
+    Int64 Value,
+    LocalizedText displayName,
+    LocalizedText description
+  }
+
+  //Base DataType for all DataTypes representing a bit mask.
+  type record OptionSet {
+    ByteString Value,
+    ByteString validBits
+  }
+
+  //Provides the meta data for a custom Structure DataType.
+  type record StructureDefinition {
+    NodeId defaultEncodingId,
+    NodeId baseDataType,
+    StructureType structureType,
+    ListOfStructureField fields
+  }
+
+  //Provides the metadata for a custom Enumeration or OptionSet DataType.
+  type record EnumDefinition {
+    ListOfEnumField fields
+  }
+
+  //Provides the metadata for a field of a custom Enumeration or OptionSet DataType.
+  type record EnumField {
+    String name
+  }
+
+  //Provides the metadata for a field of a custom Structure DataType.
+  type record StructureField {
+    String name,
+    LocalizedText description,
+    NodeId dataType,
+    Int32 valueRank,
+    Boolean isOptional
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Lists and Arrays                        //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  //Arrays of types. Used in lists, and in templates for lists
+  type record of Boolean BooleanArray;
+  type record of SByte SByteArray;
+  type record of Byte ByteArray;
+  type record of Int16 Int16Array;
+  type record of UInt16 UInt16Array;
+  type record of Int32 Int32Array;
+  type record of UInt32 UInt32Array;
+  type record of Int64 Int64Array;
+  type record of UInt64 UInt64Array;
+  type record of Float FloatArray;
+  type record of Double DoubleArray;
+  type record of DateTime DateTimeArray;
+  type record of UtcTime UtcTimeArray;
+  type record of Counter CounterArray;
+  type record of IntegerId IntegerIdArray;
+  type record of LocaleId LocaleIdArray;
+  type record of ContinuationPoint ContinuationPointArray;
+  type record of String StringArray;
+  type record of Guid GuidArray;
+  type record of ByteString ByteStringArray;
+  type record of XmlElement XmlElementArray;
+  type record of NodeId NodeIdArray;
+  type record of ExpandedNodeId ExpandedNodeIdArray;
+  type record of StatusCode StatusCodeArray;
+  type record of DiagnosticInfo DiagnosticInfoArray;
+  type record of QualifiedName QualifiedNameArray;
+  type record of LocalizedText LocalizedTextArray;
+  type record of ExtensionObject ExtensionObjectArray;
+  type record of Variant VariantArray;
+  type record of DataValue DataValueArray;
+  type record of Decimal DecimalArray;
+  type record of EnumValueType EnumValueTypeArray;
+  type record of EnumField EnumFieldArray;
+  type record of StructureField StructureFieldArray;
+  type record of ExtensibleParameter ExtensibleParameterArray;
+  type record of ApplicationDescription ApplicationDescriptionArray;
+  type record of BrowseResult BrowseResultArray;
+  type record of ContentFilterElement ContentFilterElementArray;
+  type record of ContentFilterElementResult ContentFilterElementResultArray;
+  type record of SimpleAttributeOperand SimpleAttributeOperandArray;
+  type record of EndpointDescription EndpointDescriptionArray;
+  type record of MonitoringParameters MonitoringParametersArray;
+  type record of GenericAttributeValue GenericAttributeValueArray;
+  type record of MonitoredItemNotification MonitoredItemNotificationArray;
+  type record of EventFieldList EventFieldListArray;
+  type record of QueryDataSet QueryDataSetArray;
+  type record of ReadValueId ReadValueIdArray;
+  type record of ReferenceDescription ReferenceDescriptionArray;
+  type record of RelativePathElement RelativePathElementArray;
+  type record of ApplicationInstanceCertificate ApplicationInstanceCertificateArray;
+  type record of ChannelSecurityToken ChannelSecurityTokenArray;
+  type record of UserTokenPolicy UserTokenPolicyArray;
+  type record of ServerOnNetwork ServerOnNetworkArray;
+  type record of AddNodesItem AddNodesItemArray;
+  type record of AddNodesResult AddNodesResultArray;
+  type record of AddReferencesItem AddReferencesItemArray;
+  type record of DeleteNodesItem DeleteNodesItemArray;
+  type record of DeleteReferencesItem DeleteReferencesItemArray;
+  type record of SignedSoftwareCertificate SignedSoftwareCertificateArray;
+  type record of BrowseDescription BrowseDescriptionArray;
+  type record of BrowsePath BrowsePathArray;
+  type record of BrowsePathResult BrowsePathResultArray;
+  type record of BrowsePathTarget BrowsePathTargetArray;
+  type record of NodeTypeDescription NodeTypeDescriptionArray;
+  type record of QueryDataDescription QueryDataDescriptionArray;
+  type record of ParsingResult ParsingResultArray;
+  type record of HistoryReadValueId HistoryReadValueIdArray;
+  type record of HistoryReadResult HistoryReadResultArray;
+  type record of WriteValue WriteValueArray;
+  type record of HistoryUpdateResult HistoryUpdateResultArray;
+  type record of CallMethodRequest CallMethodRequestArray;
+  type record of CallMethodResult CallMethodResultArray;
+  type record of MonitoredItemCreateRequest MonitoredItemCreateRequestArray;
+  type record of MonitoredItemCreateResult MonitoredItemCreateResultArray;
+  type record of MonitoredItemModifyRequest MonitoredItemModifyRequestArray;
+  type record of MonitoredItemModifyResult MonitoredItemModifyResultArray;
+  type record of SubscriptionAcknowledgement SubscriptionAcknowledgementArray;
+  type record of TransferResult TransferResultArray;
+
+
+
+  //Custom type for NullArrays, which are indicated with a lenght of -1
+  type record NullArray {
+    Int32 arrayLength
+  } with {
+    variant "PRESENCE(arrayLength = Null_Value)";
+  }
+
+  //Non null arrays. Their length can be zero, or any other positive value
+  type record ListOfBooleanArray {
+    Int32 arrayLength,
+    BooleanArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfSByteArray {
+    Int32 arrayLength,
+    SByteArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfByteArray {
+    Int32 arrayLength,
+    ByteArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfInt16Array {
+    Int32 arrayLength,
+    Int16Array arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfUInt16Array {
+    Int32 arrayLength,
+    UInt16Array arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfInt32Array {
+    Int32 arrayLength,
+    Int32Array arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfUInt32Array {
+    Int32 arrayLength,
+    UInt32Array arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfInt64Array {
+    Int32 arrayLength,
+    Int64Array arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfUInt64Array {
+    Int32 arrayLength,
+    UInt64Array arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfFloatArray {
+    Int32 arrayLength,
+    FloatArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfDoubleArray {
+    Int32 arrayLength,
+    DoubleArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfDateTimeArray {
+    Int32 arrayLength,
+    DateTimeArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfUtcTimeArray {
+    Int32 arrayLength,
+    UtcTimeArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfCounterArray {
+    Int32 arrayLength,
+    CounterArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfIntegerIdArray {
+    Int32 arrayLength,
+    IntegerIdArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfLocaleIdArray {
+    Int32 arrayLength,
+    LocaleIdArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfContinuationPointArray {
+    Int32 arrayLength,
+    ContinuationPointArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record NonNullString {
+    Int32 stringLength,
+    charstring stringValue
+  } with {
+    variant (stringLength) "LENGTHTO(stringValue)";
+  }
+
+  type record ListOfStringArray {
+    Int32 arrayLength,
+    StringArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfGuidArray {
+    Int32 arrayLength,
+    GuidArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record RealByteString {
+    Int32 lengthValue,
+    ByteArray byteStringValue
+  } with {
+    variant (lengthValue) "LENGTHTO(byteStringValue)";
+    variant (lengthValue) "UNIT(elements)"
+  }
+
+  type record ListOfByteStringArray {
+    Int32 arrayLength,
+    ByteStringArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfXmlElementArray {
+    Int32 arrayLength,
+    XmlElementArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfNodeIdArray {
+    Int32 arrayLength,
+    NodeIdArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfExpandedNodeIdArray {
+    Int32 arrayLength,
+    ExpandedNodeIdArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfStatusCodeArray {
+    Int32 arrayLength,
+    StatusCodeArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfDiagnosticInfoArray {
+    Int32 arrayLength,
+    DiagnosticInfoArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfQualifiedNameArray {
+    Int32 arrayLength,
+    QualifiedNameArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfLocalizedTextArray {
+    Int32 arrayLength,
+    LocalizedTextArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfExtensionObjectArray {
+    Int32 arrayLength,
+    ExtensionObjectArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfVariantArray {
+    Int32 arrayLength,
+    VariantArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfDataValueArray {
+    Int32 arrayLength,
+    DataValueArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfDecimalArray {
+    Int32 arrayLength,
+    DecimalArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfEnumValueTypeArray {
+    Int32 arrayLength,
+    EnumValueTypeArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfEnumFieldArray {
+    Int32 arrayLength,
+    EnumFieldArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfStructureFieldArray {
+    Int32 arrayLength,
+    StructureFieldArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfExtensibleParameterArray {
+    Int32 arrayLength,
+    ExtensibleParameterArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfApplicationDescriptionArray {
+    Int32 arrayLength,
+    ApplicationDescriptionArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfBrowseResultArray {
+    Int32 arrayLength,
+    BrowseResultArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfContentFilterElementArray {
+    Int32 arrayLength,
+    ContentFilterElementArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfContentFilterElementResultArray {
+    Int32 arrayLength,
+    ContentFilterElementResultArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfSimpleAttributeOperandArray {
+    Int32 arrayLength,
+    SimpleAttributeOperandArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfEndpointDescriptionArray {
+    Int32 arrayLength,
+    EndpointDescriptionArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfMonitoringParametersArray {
+    Int32 arrayLength,
+    MonitoringParametersArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfGenericAttributeValueArray {
+    Int32 arrayLength,
+    GenericAttributeValueArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfMonitoredItemNotificationArray {
+    Int32 arrayLength,
+    MonitoredItemNotificationArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfEventFieldListArray {
+    Int32 arrayLength,
+    EventFieldListArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfQueryDataSetArray {
+    Int32 arrayLength,
+    QueryDataSetArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfReadValueIdArray {
+    Int32 arrayLength,
+    ReadValueIdArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfReferenceDescriptionArray {
+    Int32 arrayLength,
+    ReferenceDescriptionArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfRelativePathElementArray {
+    Int32 arrayLength,
+    RelativePathElementArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfApplicationInstanceCertificateArray {
+    Int32 arrayLength,
+    ApplicationInstanceCertificateArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfChannelSecurityTokenArray {
+    Int32 arrayLength,
+    ChannelSecurityTokenArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfUserTokenPolicyArray {
+    Int32 arrayLength,
+    UserTokenPolicyArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfServerOnNetworkArray {
+    Int32 arrayLength,
+    ServerOnNetworkArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfAddNodesItemArray {
+    Int32 arrayLength,
+    AddNodesItemArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfAddNodesResultArray {
+    Int32 arrayLength,
+    AddNodesResultArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfAddReferencesItemArray {
+    Int32 arrayLength,
+    AddReferencesItemArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfDeleteNodesItemArray {
+    Int32 arrayLength,
+    DeleteNodesItemArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfDeleteReferencesItemArray {
+    Int32 arrayLength,
+    DeleteReferencesItemArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfSignedSoftwareCertificateArray {
+    Int32 arrayLength,
+    SignedSoftwareCertificateArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfBrowseDescriptionArray {
+    Int32 arrayLength,
+    BrowseDescriptionArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfBrowsePathArray {
+    Int32 arrayLength,
+    BrowsePathArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfBrowsePathResultArray {
+    Int32 arrayLength,
+    BrowsePathResultArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfBrowsePathTargetArray {
+    Int32 arrayLength,
+    BrowsePathTargetArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfNodeTypeDescriptionArray {
+    Int32 arrayLength,
+    NodeTypeDescriptionArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfQueryDataDescriptionArray {
+    Int32 arrayLength,
+    QueryDataDescriptionArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfParsingResultArray {
+    Int32 arrayLength,
+    ParsingResultArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfHistoryReadValueIdArray {
+    Int32 arrayLength,
+    HistoryReadValueIdArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfHistoryReadResultArray {
+    Int32 arrayLength,
+    HistoryReadResultArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfWriteValueArray {
+    Int32 arrayLength,
+    WriteValueArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfHistoryUpdateResultArray {
+    Int32 arrayLength,
+    HistoryUpdateResultArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfCallMethodRequestArray {
+    Int32 arrayLength,
+    CallMethodRequestArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfCallMethodResultArray {
+    Int32 arrayLength,
+    CallMethodResultArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfMonitoredItemCreateRequestArray {
+    Int32 arrayLength,
+    MonitoredItemCreateRequestArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfMonitoredItemCreateResultArray {
+    Int32 arrayLength,
+    MonitoredItemCreateResultArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfMonitoredItemModifyRequestArray {
+    Int32 arrayLength,
+    MonitoredItemModifyRequestArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfMonitoredItemModifyResultArray {
+    Int32 arrayLength,
+    MonitoredItemModifyResultArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfSubscriptionAcknowledgementArray {
+    Int32 arrayLength,
+    SubscriptionAcknowledgementArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  type record ListOfTransferResultArray {
+    Int32 arrayLength,
+    TransferResultArray arrayValues
+  } with {
+    variant (arrayLength) "LENGTHTO(arrayValues)";
+    variant (arrayLength) "UNIT(elements)"
+  }
+
+  //List of types. These are used by the services
+  //Can be null array, or non null array. Null arrays have a length of -1
+  type union ListOfBoolean {
+    NullArray nullArray,
+    ListOfBooleanArray realArray
+  }
+
+  type union ListOfSByte {
+    NullArray nullArray,
+    ListOfSByteArray realArray
+  }
+
+  type union ListOfByte {
+    NullArray nullArray,
+    ListOfByteArray realArray
+  }
+
+  type union ListOfInt16 {
+    NullArray nullArray,
+    ListOfInt16Array realArray
+  }
+
+  type union ListOfUInt16 {
+    NullArray nullArray,
+    ListOfUInt16Array realArray
+  }
+
+  type union ListOfInt32 {
+    NullArray nullArray,
+    ListOfInt32Array realArray
+  }
+
+  type union ListOfUInt32 {
+    NullArray nullArray,
+    ListOfUInt32Array realArray
+  }
+
+  type union ListOfInt64 {
+    NullArray nullArray,
+    ListOfInt64Array realArray
+  }
+
+  type union ListOfUInt64 {
+    NullArray nullArray,
+    ListOfUInt64Array realArray
+  }
+
+  type union ListOfFloat {
+    NullArray nullArray,
+    ListOfFloatArray realArray
+  }
+
+  type union ListOfDouble {
+    NullArray nullArray,
+    ListOfDoubleArray realArray
+  }
+
+  type union ListOfDateTime {
+    NullArray nullArray,
+    ListOfDateTimeArray realArray
+  }
+
+  type union ListOfUtcTime {
+    NullArray nullArray,
+    ListOfUtcTimeArray realArray
+  }
+
+  type union ListOfCounter {
+    NullArray nullArray,
+    ListOfCounterArray realArray
+  }
+
+  type union ListOfIntegerId {
+    NullArray nullArray,
+    ListOfIntegerIdArray realArray
+  }
+
+  type union ListOfLocaleId {
+    NullArray nullArray,
+    ListOfLocaleIdArray realArray
+  }
+
+  type union ListOfContinuationPoint {
+    NullArray nullArray,
+    ListOfContinuationPointArray realArray
+  }
+
+  type union ListOfString {
+    NullArray nullArray,
+    ListOfStringArray realArray
+  }
+
+   type union ListOfGuid {
+    NullArray nullArray,
+    ListOfGuidArray realArray
+  }
+
+  type union ListOfByteString {
+    NullArray nullArray,
+    ListOfByteStringArray realArray
+  }
+
+  type union ListOfXmlElement {
+    NullArray nullArray,
+    ListOfXmlElementArray realArray
+  }
+
+  type union ListOfNodeId {
+    NullArray nullArray,
+    ListOfNodeIdArray realArray
+  }
+
+  type union ListOfExpandedNodeId {
+    NullArray nullArray,
+    ListOfExpandedNodeIdArray realArray
+  }
+
+  type union ListOfStatusCode {
+    NullArray nullArray,
+    ListOfStatusCodeArray realArray
+  }
+
+  type union ListOfDiagnosticInfo {
+    NullArray nullArray,
+    ListOfDiagnosticInfoArray realArray
+  }
+
+  type union ListOfQualifiedName {
+    NullArray nullArray,
+    ListOfQualifiedNameArray realArray
+  }
+
+  type union ListOfLocalizedText {
+    NullArray nullArray,
+    ListOfLocalizedTextArray realArray
+  }
+
+  type union ListOfExtensionObject {
+    NullArray nullArray,
+    ListOfExtensionObjectArray realArray
+  }
+
+  type union ListOfVariant {
+    NullArray nullArray,
+    ListOfVariantArray realArray
+  }
+
+  type union ListOfDataValue {
+    NullArray nullArray,
+    ListOfDataValueArray realArray
+  }
+
+  type union ListOfDecimal {
+    NullArray nullArray,
+    ListOfDecimalArray realArray
+  }
+
+  type union ListOfEnumValueType {
+    NullArray nullArray,
+    ListOfEnumValueTypeArray realArray
+  }
+
+  type union ListOfEnumField {
+    NullArray nullArray,
+    ListOfEnumFieldArray realArray
+  }
+
+  type union ListOfStructureField {
+    NullArray nullArray,
+    ListOfStructureFieldArray realArray
+  }
+
+  type union ListOfExtensibleParameter {
+    NullArray nullArray,
+    ListOfExtensibleParameterArray realArray
+  }
+
+  type union ListOfApplicationDescription {
+    NullArray nullArray,
+    ListOfApplicationDescriptionArray realArray
+  }
+
+  type union ListOfBrowseResult {
+    NullArray nullArray,
+    ListOfBrowseResultArray realArray
+  }
+
+  type union ListOfContentFilterElement {
+    NullArray nullArray,
+    ListOfContentFilterElementArray realArray
+  }
+
+  type union ListOfContentFilterElementResult {
+    NullArray nullArray,
+    ListOfContentFilterElementResultArray realArray
+  }
+
+  type union ListOfSimpleAttributeOperand {
+    NullArray nullArray,
+    ListOfSimpleAttributeOperandArray realArray
+  }
+
+  type union ListOfEndpointDescription {
+    NullArray nullArray,
+    ListOfEndpointDescriptionArray realArray
+  }
+
+  type union ListOfMonitoringParameters {
+    NullArray nullArray,
+    ListOfMonitoringParametersArray realArray
+  }
+
+  type union ListOfGenericAttributeValue {
+    NullArray nullArray,
+    ListOfGenericAttributeValueArray realArray
+  }
+
+  type union ListOfMonitoredItemNotification {
+    NullArray nullArray,
+    ListOfMonitoredItemNotificationArray realArray
+  }
+
+  type union ListOfEventFieldList {
+    NullArray nullArray,
+    ListOfEventFieldListArray realArray
+  }
+
+  type union ListOfQueryDataSet {
+    NullArray nullArray,
+    ListOfQueryDataSetArray realArray
+  }
+
+  type union ListOfReadValueId {
+    NullArray nullArray,
+    ListOfReadValueIdArray realArray
+  }
+
+  type union ListOfReferenceDescription {
+    NullArray nullArray,
+    ListOfReferenceDescriptionArray realArray
+  }
+
+  type union ListOfRelativePathElement {
+    NullArray nullArray,
+    ListOfRelativePathElementArray realArray
+  }
+
+  type union ListOfApplicationInstanceCertificate {
+    NullArray nullArray,
+    ListOfApplicationInstanceCertificateArray realArray
+  }
+
+  type union ListOfChannelSecurityToken {
+    NullArray nullArray,
+    ListOfChannelSecurityTokenArray realArray
+  }
+
+   type union ListOfUserTokenPolicy {
+    NullArray nullArray,
+    ListOfUserTokenPolicyArray realArray
+  }
+
+  type union ListOfServerOnNetwork {
+    NullArray nullArray,
+    ListOfServerOnNetworkArray realArray
+  }
+
+  type union ListOfAddNodesItem {
+    NullArray nullArray,
+    ListOfAddNodesItemArray realArray
+  }
+
+  type union ListOfAddNodesResult {
+    NullArray nullArray,
+    ListOfAddNodesResultArray realArray
+  }
+
+  type union ListOfAddReferencesItem {
+    NullArray nullArray,
+    ListOfAddReferencesItemArray realArray
+  }
+
+  type union ListOfDeleteNodesItem {
+    NullArray nullArray,
+    ListOfDeleteNodesItemArray realArray
+  }
+
+  type union ListOfDeleteReferencesItem {
+    NullArray nullArray,
+    ListOfDeleteReferencesItemArray realArray
+  }
+
+  type union ListOfSignedSoftwareCertificate {
+    NullArray nullArray,
+    ListOfSignedSoftwareCertificateArray realArray
+  }
+
+  type union ListOfBrowseDescription {
+    NullArray nullArray,
+    ListOfBrowseDescriptionArray realArray
+  }
+
+  type union ListOfBrowsePath {
+    NullArray nullArray,
+    ListOfBrowsePathArray realArray
+  }
+
+  type union ListOfBrowsePathResult {
+    NullArray nullArray,
+    ListOfBrowsePathResultArray realArray
+  }
+
+  type union ListOfBrowsePathTarget {
+    NullArray nullArray,
+    ListOfBrowsePathTargetArray realArray
+  }
+
+  type union ListOfNodeTypeDescription {
+    NullArray nullArray,
+    ListOfNodeTypeDescriptionArray realArray
+  }
+
+  type union ListOfQueryDataDescription {
+    NullArray nullArray,
+    ListOfQueryDataDescriptionArray realArray
+  }
+
+  type union ListOfParsingResult {
+    NullArray nullArray,
+    ListOfParsingResultArray realArray
+  }
+
+  type union ListOfHistoryReadValueId {
+    NullArray nullArray,
+    ListOfHistoryReadValueIdArray realArray
+  }
+
+  type union ListOfHistoryReadResult {
+    NullArray nullArray,
+    ListOfHistoryReadResultArray realArray
+  }
+
+  type union ListOfWriteValue {
+    NullArray nullArray,
+    ListOfWriteValueArray realArray
+  }
+
+  type union ListOfHistoryUpdateResult {
+    NullArray nullArray,
+    ListOfHistoryUpdateResultArray realArray
+  }
+
+  type union ListOfCallMethodRequest {
+    NullArray nullArray,
+    ListOfCallMethodRequestArray realArray
+  }
+
+  type union ListOfCallMethodResult {
+    NullArray nullArray,
+    ListOfCallMethodResultArray realArray
+  }
+
+  type union ListOfMonitoredItemCreateRequest {
+    NullArray nullArray,
+    ListOfMonitoredItemCreateRequestArray realArray
+  }
+
+  type union ListOfMonitoredItemCreateResult {
+    NullArray nullArray,
+    ListOfMonitoredItemCreateResultArray realArray
+  }
+
+  type union ListOfMonitoredItemModifyRequest {
+    NullArray nullArray,
+    ListOfMonitoredItemModifyRequestArray realArray
+  }
+
+  type union ListOfMonitoredItemModifyResult {
+    NullArray nullArray,
+    ListOfMonitoredItemModifyResultArray realArray
+  }
+
+  type union ListOfSubscriptionAcknowledgement {
+    NullArray nullArray,
+    ListOfSubscriptionAcknowledgementArray realArray
+  }
+
+  type union ListOfTransferResult {
+    NullArray nullArray,
+    ListOfTransferResultArray realArray
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                    Common Parameters                    //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  //Information that describes an application.
+  type record ApplicationDescription {
+    String applicationUri,
+    String productUri,
+    LocalizedText applicationName,
+    ApplicationType applicationType,
+    String gatewayServerUri,
+    String discoveryProfileUri,
+    ListOfString discoveryUrls
+  }
+
+  //Information that identified an application instance
+  type record ApplicationInstanceSubjectIdentifier {
+    String name
+  }
+
+  //Information that identified the issuer of an application instance
+  type record ApplicationInstanceIssuerIdentifier {
+    String productName ,
+    String organisation
+  }
+
+  type record BrowseResult {
+    StatusCode statusCode,
+    ContinuationPoint continuationPoint,
+    ListOfReferenceDescription References
+  }
+
+  type record ContentFilter {
+    ListOfContentFilterElement elements
+  }
+
+  type record ContentFilterElement {
+    FilterOperator filterOperator,
+    ListOfExtensibleParameter filterOperands
+  }
+
+  type record ContentFilterResult {
+    ListOfContentFilterElementResult elementResults,
+    ListOfDiagnosticInfo elementDiagnosticInfos
+  }
+
+  type record ContentFilterElementResult {
+    StatusCode statusCode,
+    ListOfStatusCode operandStatusCodes,
+    ListOfDiagnosticInfo operandDiagnosticInfos
+  }
+
+  type record ElementOperand {
+    UInt32 index
+  }
+
+  type record LiteralOperand {
+    BaseDataType Value
+  }
+
+  type record AttributeOperand {
+    NodeId nodeId,
+    String alias,
+    RelativePath browsePath,
+    IntegerId attributeId,
+    NumericRange indexRange
+  }
+
+  type record SimpleAttributeOperand {
+    NodeId typeId,
+    ListOfQualifiedName browsePath,
+    IntegerId attributeId,
+    NumericRange indexRange
+  }
+
+  type record MdnsDiscoveryConfiguration {
+    String mdnsServerName,
+    ListOfString serverCapabilities
+  }
+
+  type record EndpointDescription {
+    String endpointUrl,
+    ApplicationDescription server,
+    ByteString  serverCertificate,
+    MessageSecurityMode securityMode,
+    String securityPolicyUri,
+    ListOfUserTokenPolicy userIdentityTokens,
+    String transportProfileUri,
+    Byte securityLevel
+  }
+
+  type record MonitoringParameters {
+    IntegerId clientHandle,
+    Duration samplingInterval,
+    ExtensibleParameter filter,
+    Counter queueSize,
+    Boolean discardOldest
+  }
+
+  type record DataChangeFilter {
+    DataChangeTrigger Trigger,
+    UInt32 deadbandType,
+    Double deadbandValue
+  }
+
+  type record EventFilter {
+    ListOfSimpleAttributeOperand selectClauses,
+    ContentFilter whereClause
+  }
+
+  type record EventFilterResult {
+    ListOfStatusCode selectClauseResults,
+    ListOfDiagnosticInfo selectClauseDiagnosticInfos,
+    ContentFilterResult whereClauseResult
+  }
+
+  type record AggregateFilter {
+    UtcTime startTime,
+    NodeId aggregateType,
+    Duration processingInterval,
+    AggregateConfiguration aggregateConfiguration,
+    Boolean useServerCapabilitiesDefaults,
+    Boolean treatUncertainAsBad,
+    Byte percentDataBad,
+    Byte percentDataGood,
+    Boolean useSlopedExtrapolation
+  }
+
+  type record AggregateConfiguration {
+    Boolean TreatUncertainAsBad,
+    Boolean useSeverCapabilitiesDefaults,
+    Byte PercentDataBad,
+    Byte PercentDataGood,
+    Boolean UseSlopedExtrapolation
+  }
+
+  type record AggregateFilterResult {
+    UtcTime revisedStartTime,
+    Duration revisedProcessingInterval
+  }
+
+  type record ObjectAttributes {
+    Bit displayNameBit,
+    Bit descriptionBit,
+    Bit eventNotifierBit,
+    Bit writeMaskBit,
+    Bit userWriteMaskBit,
+    Bit reserveBits[25],
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Byte eventNotifier optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  } with {
+    variant (displayName) "PRESENCE(displayNameBit = 1)";
+    variant (description) "PRESENCE(descriptionBit = 1)";
+    variant (eventNotifier) "PRESENCE(eventNotifierBit = 1)";
+    variant (writeMask) "PRESENCE(writeMaskBit = 1)";
+    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";
+  }
+
+  type record VariableAttributes {
+    Bit displayNameBit,
+    Bit descriptionBit,
+    Bit ValueBit,
+    Bit dataTypeBit,
+    Bit valueRankBit,
+    Bit arrayDimensionsBit,
+    Bit accessLevelBit,
+    Bit userAccessLevelBit,
+    Bit minimumSamplingIntervalBit,
+    Bit historizingBit,
+    Bit writeMaskBit,
+    Bit userWriteMaskBit,
+    Bit reserveBits[20],
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    DataType Value optional,
+    NodeId dataType optional,
+    Int32 valueRank optional,
+    ListOfUInt32 arrayDimensions optional,
+    Byte accessLevel optional,
+    Byte userAccessLevel optional,
+    Duration minimumSamplingInterval optional,
+    Boolean historizing optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  }with {
+    variant (displayName) "PRESENCE(displayNameBit = 1)";
+    variant (description) "PRESENCE(descriptionBit = 1)";
+    variant (Value) "PRESENCE(ValueBit = 1)";
+    variant (dataType) "PRESENCE(dataTypeBit = 1)";
+    variant (valueRank) "PRESENCE(valueRankBit = 1)";
+    variant (arrayDimensions) "PRESENCE(arrayDimensionsBit = 1)";
+    variant (accessLevel) "PRESENCE(accessLevelBit = 1)";
+    variant (userAccessLevel) "PRESENCE(userAccessLevelBit = 1)";
+    variant (minimumSamplingInterval) "PRESENCE(minimumSamplingIntervalBit = 1)";
+    variant (historizing) "PRESENCE(historizingBit = 1)";
+    variant (writeMask) "PRESENCE(writeMaskBit = 1)";
+    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";
+  }
+
+  type record MethodAttributes {
+    Bit displayNameBit,
+    Bit descriptionBit,
+    Bit executableBit,
+    Bit userExecutableBit,
+    Bit writeMaskBit,
+    Bit userWriteMaskBit,
+    Bit reserveBits[26],
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Boolean executable optional,
+    Boolean userExecutable optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  } with {
+    variant (displayName) "PRESENCE(displayNameBit = 1)";
+    variant (description) "PRESENCE(descriptionBit = 1)";
+    variant (executable) "PRESENCE(executableBit = 1)";
+    variant (userExecutable) "PRESENCE(userExecutableBit = 1)";
+    variant (writeMask) "PRESENCE(writeMaskBit = 1)";
+    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";
+  }
+
+  type record ObjectTypeAttributes {
+    Bit displayNameBit,
+    Bit descriptionBit,
+    Bit isAbstractBit,
+    Bit writeMaskBit,
+    Bit userWriteMaskBit,
+    Bit reserveBits[27],
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Boolean isAbstract optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  } with {
+    variant (displayName) "PRESENCE(displayNameBit = 1)";
+    variant (description) "PRESENCE(descriptionBit = 1)";
+    variant (isAbstract) "PRESENCE(isAbstractBit = 1)";
+    variant (writeMask) "PRESENCE(writeMaskBit = 1)";
+    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";
+  }
+
+  type record VariableTypeAttributes {
+    Bit displayNameBit,
+    Bit descriptionBit,
+    Bit ValueBit,
+    Bit dataTypeBit,
+    Bit valueRankBit,
+    Bit arrayDimensionsBit,
+    Bit isAbstractBit,
+    Bit writeMaskBit,
+    Bit userWriteMaskBit,
+    Bit reserveBits[23],
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    DataType Value optional,
+    NodeId dataType optional,
+    Int32 valueRank optional,
+    ListOfUInt32 arrayDimensions optional,
+    Boolean isAbstract optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  } with {
+    variant (displayName) "PRESENCE(displayNameBit = 1)";
+    variant (description) "PRESENCE(descriptionBit = 1)";
+    variant (Value) "PRESENCE(ValueBit = 1)";
+    variant (dataType) "PRESENCE(dataTypeBit = 1)";
+    variant (valueRank) "PRESENCE(valueRankBit = 1)";
+    variant (arrayDimensions) "PRESENCE(arrayDimensionsBit = 1)";
+    variant (isAbstract) "PRESENCE(isAbstractBit = 1)";
+    variant (writeMask) "PRESENCE(writeMaskBit = 1)";
+    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";
+  }
+
+  type record ReferenceTypeAttributes {
+    Bit displayNameBit,
+    Bit descriptionBit,
+    Bit isAbstractBit,
+    Bit symmetricBit,
+    Bit inverseNameBit,
+    Bit writeMaskBit,
+    Bit userWriteMaskBit,
+    Bit reserveBits[25],
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Boolean isAbstract optional,
+    Boolean symmetric optional,
+    LocalizedText inverseName optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  } with {
+    variant (displayName) "PRESENCE(displayNameBit = 1)";
+    variant (description) "PRESENCE(descriptionBit = 1)";
+    variant (isAbstract) "PRESENCE(isAbstractBit = 1)";
+    variant (symmetric) "PRESENCE(symmetricBit = 1)";
+    variant (inverseName) "PRESENCE(inverseNameBit = 1)";
+    variant (writeMask) "PRESENCE(writeMaskBit = 1)";
+    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";
+  }
+
+  type record DataTypeAttributes {
+    Bit displayNameBit,
+    Bit descriptionBit,
+    Bit isAbstractBit,
+    Bit writeMaskBit,
+    Bit userWriteMaskBit,
+    Bit reserveBits[27],
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Boolean isAbstract optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  } with {
+    variant (displayName) "PRESENCE(displayNameBit = 1)";
+    variant (description) "PRESENCE(descriptionBit = 1)";
+    variant (isAbstract) "PRESENCE(isAbstractBit = 1)";
+    variant (writeMask) "PRESENCE(writeMaskBit = 1)";
+    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";
+  }
+
+  type record ViewAttributes {
+    Bit displayNameBit,
+    Bit descriptionBit,
+    Bit containsNoLoopsBit,
+    Bit eventNotifierBit,
+    Bit writeMaskBit,
+    Bit userWriteMaskBit,
+    Bit reserveBits[26],
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Boolean containsNoLoops optional,
+    Byte eventNotifier optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  } with {
+    variant (displayName) "PRESENCE(displayNameBit = 1)";
+    variant (description) "PRESENCE(descriptionBit = 1)";
+    variant (containsNoLoops) "PRESENCE(containsNoLoopsBit = 1)";
+    variant (eventNotifier) "PRESENCE(eventNotifierBit = 1)";
+    variant (writeMask) "PRESENCE(writeMaskBit = 1)";
+    variant (userWriteMask) "PRESENCE(userWriteMaskBit = 1)";
+  }
+
+  type record GenericAttributes {
+    ListOfGenericAttributeValue attributeValues
+  }
+
+  type record GenericAttributeValue {
+    IntegerId attributeId,
+    BaseDataType Value
+  }
+
+  type record DataChangeNotification {
+    ListOfMonitoredItemNotification monitoredItems,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record MonitoredItemNotification {
+    IntegerId clientHandle,
+    DataValue Value
+  }
+
+  type record EventNotificationList {
+    ListOfEventFieldList events
+  }
+
+  type record EventFieldList {
+    IntegerId clientHandle,
+    ListOfBaseDataType eventFields
+  }
+
+  type record StatusChangeNotification {
+    StatusCode status,
+    DiagnosticInfo diagnosticInfo
+  }
+
+  type record NotificationMessage {
+    Counter sequenceNumber,
+    UtcTime publishTime,
+    ListOfExtensibleParameter notificationData
+  }
+
+  type record QueryDataSet {
+    ExpandedNodeId nodeId,
+    ExpandedNodeId typeDefinitionNode,
+    ListOfBaseDataType values
+  }
+
+  type record ReadValueId {
+    NodeId nodeId,
+    IntegerId attributeId,
+    NumericRange indexRange,
+    QualifiedName dataEncoding
+  }
+
+  type record ReferenceDescription {
+    NodeId referenceTypeId,
+    Boolean isForward,
+    ExpandedNodeId nodeId,
+    QualifiedName browseName,
+    LocalizedText displayName,
+    NodeClass nodeClass,
+    ExpandedNodeId typeDefinition
+  }
+
+  type record RelativePath {
+    ListOfRelativePathElement elements
+  }
+
+  type record RelativePathElement {
+    NodeId referenceTypeId,
+    Boolean isInverse,
+    Boolean includeSubtypes,
+    QualifiedName targetName
+  }
+
+  type record RegisteredServer {
+    String serverUri,
+    String productUri,
+    ListOfLocalizedText serverNames,
+    ApplicationType serverType,
+    String gatewayServerUri,
+    ListOfString discoveryUrls,
+    String semaphoreFilePath,
+    Boolean isOnline
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //         Structures for Security (Incomplete)            //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record ApplicationInstanceCertificate {
+    String version,
+    ByteString serialNumber,
+    String signatureAlgorithm,
+    ByteString Signature,
+    ApplicationInstanceIssuerIdentifier issuer,
+    UtcTime validFrom,
+    UtcTime validTo,
+    ApplicationInstanceSubjectIdentifier subject,
+    String applicationUri,
+    ListOfString hostnames,
+    ByteString publicKey,
+    ListOfString keyUsage
+  }
+
+  type record ChannelSecurityToken {
+    UInt32 channelId,
+    UInt32 tokenId,
+    UtcTime createdAt,
+    UInt32 revisedLifetime
+  }
+
+  type record EncryptedSecret {
+    NodeId TypeId,
+    Byte EncodingMask,
+    UInt32 Length,
+    String SecurityPolicyUri,
+    ByteString EncryptingCertificate,
+    DateTime SigningTime,
+    UInt16 PolicyHeaderLength,
+    ByteString SigningKey,
+    ByteString EncryptingKey,
+    ByteString InitializationVector,
+    ByteString Nonce,
+    Byte PolicyHeaderPadding optional,
+    UInt16 PolicyHeaderPaddingSize,
+    ByteString Secret,
+    Byte PayloadPadding optional,
+    UInt16 PayloadPaddingSize,
+    Byte Signature optional
+  }
+
+  type record RsaEncryptedSecret {
+    NodeId TypeId,
+    Byte EncodingMask,
+    UInt32 Length,
+    String SecurityPolicyUri,
+    ByteString EncryptingCertificate,
+    DateTime SigningTime,
+    UInt16 PolicyHeaderLength,
+    ByteString SigningKey,
+    ByteString EncryptingKey,
+    ByteString InitializationVector,
+    ByteString Nonce,
+    Byte PolicyHeaderPadding optional,
+    UInt16 PolicyHeaderPaddingSize,
+    ByteString Secret,
+    Byte PayloadPadding optional,
+    UInt16 PayloadPaddingSize,
+    Byte Signature optional
+  }
+
+  type record AnonymousIdentityToken {
+    String policyId
+  }
+
+  type record UserNameIdentityToken {
+    String policyId,
+    String userName,
+    ByteString password,
+    String encryptionAlgorithm
+  }
+
+  type record X509IdentityToken {
+    String policyId,
+    ByteString certificateData
+  }
+
+  type record IssuedIdentityToken {
+    String policyId,
+    ByteString tokenData,
+    String encryptionAlgorithm
+  }
+
+  type record UserTokenPolicy {
+    String policyId,
+    UserIdentityTokenType tokenType,
+    String issuedTokenType,
+    String issuerEndpointUrl,
+    String securityPolicyUri
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Structures for  Services                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record ViewDescription {
+    NodeId viewId,
+    UtcTime timestamp,
+    UInt32 viewVersion
+  }
+
+  type record TrustListDataType {
+    TrustListMasks specifiedLists,
+    ListOfByteString trustedCertificates,
+    ListOfByteString trustedCrls,
+    ListOfByteString issuerCertificates,
+    ListOfByteString issuerCrls
+  }
+
+  type record ServerOnNetwork {
+    UInt32 recordId,
+    String serverName,
+    String discoveryUrl,
+    ListOfString serverCapabilities
+  }
+
+  type record AddNodesItem {
+    ExpandedNodeId parentNodeId,
+    NodeId referenceTypeId,
+    QualifiedName browseName,
+    NodeClass nodeClass,
+    ExtensibleParameter nodeAttributes,
+    ExpandedNodeId typeDefinition
+  }
+
+  type record AddNodesResult {
+    StatusCode statusCode,
+    NodeId addedNodeId,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record AddReferencesItem {
+    NodeId sourceNodeId,
+    NodeId referenceTypeId,
+    Boolean isForward,
+    String targetServerUri,
+    ExpandedNodeId targetNodeId,
+    NodeClass targetNodeClass
+  }
+
+  type record DeleteNodesItem {
+    NodeId nodeId,
+    Boolean deleteTargetReferences
+  }
+
+  type record DeleteReferencesItem {
+    NodeId sourceNodeId,
+    NodeId referenceTypeId,
+    Boolean isForward,
+    ExpandedNodeId targetNodeId,
+    Boolean deleteBidirectional
+  }
+
+    type record BrowseDescription {
+    NodeId nodeId,
+    BrowseDirection browseDirection,
+    NodeId referenceTypeId,
+    Boolean includeSubtypes,
+    UInt32 nodeClassMask,
+    UInt32 resultMask
+  }
+
+  type record SignatureData {
+    String algorithm,
+    ByteString Signature
+  }
+
+  type record SignedSoftwareCertificate {
+    ByteString certificateData,
+    ByteString Signature
+  }
+
+  type record BrowsePath {
+    NodeId startingNode,
+    RelativePath relativePath
+  }
+
+  type record BrowsePathResult {
+    StatusCode statusCode,
+    ListOfBrowsePathTarget targets
+  }
+
+  type record BrowsePathTarget {
+    ExpandedNodeId targetId,
+    Index remainingPathIndex
+  }
+
+  type record NodeTypeDescription {
+    ExpandedNodeId typeDefinitionNode,
+    Boolean includeSubtypes,
+    ListOfQueryDataDescription dataToReturn
+  }
+
+  type record QueryDataDescription {
+    RelativePath relativePath,
+    IntegerId attributeId,
+    NumericRange indexRange
+  }
+
+  type record ParsingResult {
+    StatusCode statusCode,
+    ListOfStatusCode dataStatusCodes,
+    ListOfDiagnosticInfo dataDiagnosticInfos
+  }
+
+  type record ReadEventDetails {
+    Counter numValuesPerNode,
+    UtcTime startTime,
+    UtcTime endTime,
+    EventFilter Filter
+  }
+
+  type record ReadRawModifiedDetails {
+    Boolean isReadModified ,
+    UtcTime startTime,
+    UtcTime endTime,
+    Counter numValuesPerNode,
+    Boolean returnBounds
+  }
+
+  type record ReadProcessedDetails {
+    UtcTime startTime,
+    UtcTime endTime,
+    Duration ProcessingInterval,
+    ListOfNodeId aggregateType,
+    AggregateConfiguration aggregateConfiguration
+  }
+
+  type record ReadAtTimeDetails {
+    ListOfUtcTime reqTimes,
+    Boolean useSimpleBounds
+  }
+
+  type record HistoryReadValueId {
+    NodeId nodeId,
+    NumericRange indexRange,
+    QualifiedName dataEncoding,
+    ByteString continuationPoint
+  }
+
+  type record HistoryReadResult {
+    StatusCode statusCode,
+    ByteString continuationPoint,
+    ExtensibleParameter historyData
+  }
+
+  type record WriteValue {
+    NodeId nodeId,
+    IntegerId attributeId,
+    NumericRange indexRange,
+    DataValue datavalue
+  }
+
+  type record UpdateDataDetails {
+    NodeId nodeId,
+    PerformUpdateType performInsertReplace,
+    ListOfDataValue updateValues
+  }
+
+  type record UpdateStructureDataDetails {
+    NodeId nodeId,
+    PerformUpdateTypeExtended performInsertReplace,
+    ListOfDataValue updateValues
+  }
+
+  type record UpdateEventDetails {
+    NodeId nodeId,
+    PerformUpdateType performInsertReplace,
+    EventFilter filter,
+    ListOfDataValue updateValues
+  }
+
+  type record DeleteRawModifiedDetails {
+    NodeId nodeId,
+    Boolean isDeleteModified,
+    UtcTime startTime,
+    UtcTime endTime
+  }
+
+  type record DeleteAtTimeDetails {
+    NodeId nodeId,
+    ListOfUtcTime reqTimes
+  }
+
+  type record DeleteEventDetails {
+    NodeId nodeId,
+    ListOfByteString eventId
+  }
+
+  type record HistoryUpdateResult {
+    StatusCode statusCode,
+    ListOfStatusCode operationResults,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record CallMethodRequest {
+    NodeId objectId,
+    NodeId methodId,
+    ListOfVariant inputArguments
+  }
+
+  type record CallMethodResult {
+    StatusCode statusCode,
+    ListOfStatusCode inputArgumentResults,
+    ListOfDiagnosticInfo inputArgumentDiagnosticInfos,
+    ListOfVariant outputArguments
+  }
+
+  type record MonitoredItemCreateRequest {
+    ReadValueId itemToMonitor,
+    MonitoringMode monitoringMode,
+    MonitoringParameters requestedParameters
+  }
+
+  type record MonitoredItemCreateResult {
+    StatusCode statusCode,
+    IntegerId monitoredItemId,
+    Duration revisedSamplingInterval,
+    Counter revisedQueueSize,
+    ExtensibleParameter filterResult
+  }
+
+  type record MonitoredItemModifyRequest {
+    IntegerId monitoredItemId,
+    MonitoringParameters requestedParameters
+  }
+
+  type record MonitoredItemModifyResult {
+    StatusCode statusCode,
+    Duration revisedSamplingInterval,
+    Counter revisedQueueSize,
+    ExtensibleParameter filterResult
+  }
+
+  type record SubscriptionAcknowledgement {
+    IntegerId subscriptionId,
+    Counter sequenceNumber
+  }
+
+  type record TransferResult {
+    StatusCode statusCode,
+    ListOfCounter availableSequenceNumbers
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                         Headers                         //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+
+  type record MessageHeader {
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize
+  }
+
+  type union SecurityHeader {
+    AsymmetricSecurityHeader asymmetricSecurityHeader,
+    SymmetricSecurityHeader symmetricSecurityHeader
+  }
+
+  type record SequenceHeader {
+    UInt32 SequenceNumber,
+    UInt32 RequestId
+  }
+
+  type record AsymmetricSecurityHeader {
+    Int32 SecurityPolicyUriLength,
+    ListOfByte SecurityPolicyUri,
+    Int32 SenderCertificateLength,
+    ListOfByte SenderCertificate,
+    Int32 ReceiverCertificateThumbprintLength,
+    ListOfByte ReceiverCertificateThumbprint
+  }
+
+  type record SymmetricSecurityHeader {
+    UInt32 TokenId
+  }
+
+  type record MessageFooter {
+    Byte PaddingSize optional,
+    ListOfByte Padding optional,
+    Byte ExtraPaddingSize optional,
+    ListOfByte Signature optional
+  } with {
+    variant (PaddingSize) "LENGTHTO(Padding)";
+  }
+
+  type record AdditionalHeader {
+    ExpandedNodeId typeId,
+    Byte Value
+  }
+
+  type record RequestHeader {
+    SessionAuthenticationToken authenticationToken,
+    UtcTime timestamp,
+    IntegerId requestHandle,
+    UInt32 returnDiagnostics,
+    String auditEntryId,
+    UInt32 timeoutHint,
+    AdditionalHeader additionalHeader
+  }
+
+  type record ResponseHeader {
+    UtcTime timestamp,
+    IntegerId requestHandle,
+    StatusCode serviceResult,
+    DiagnosticInfo serviceDiagnostics,
+    ListOfString stringTable,
+    AdditionalHeader additionalHeader
+  }
+
+  type record ServiceFault {
+    ResponseHeader responseHeader
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                     Basic Messages                      //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record HelloMessage {
+    UInt32 version,
+    UInt32 receiveBufferSize,
+    UInt32 sendBufferSize,
+    UInt32 maxMessageSize,
+    UInt32 maxChunkCount,
+    String endPointUrl
+  }
+
+  type record AckMessage {
+    UInt32 version,
+    UInt32 receiveBufferSize,
+    UInt32 sendBufferSize,
+    UInt32 maxMessageSize,
+    UInt32 maxChunkCount
+  }
+
+  type record ErrorMessage {
+    UInt32 errorCode,
+    String reason
+  }
+
+  type record ReverseHelloMessage {
+    String serverUri,
+    String endPointUrl
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Discovery Service Sets                  //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record FindServiceRequest {
+    RequestHeader requestHeader,
+    String endpointUrl,
+    ListOfLocaleId localeIds,
+    ListOfString serverUris
+  }
+
+  type record FindServiceResponse {
+    ResponseHeader responseHeader,
+    ListOfApplicationDescription servers
+  }
+
+  type record FindServersOnNetworkRequest {
+    RequestHeader requestHeader,
+    Counter startingRecordId,
+    UInt32 maxRecordsToReturn,
+    ListOfString serverCapabilityFilter
+  }
+
+  type record FindServersOnNetworkResponse {
+    ResponseHeader responseHeader,
+    UtcTime lastCounterResetTime,
+    ListOfServerOnNetwork servers
+  }
+
+  type record GetEndpointsRequest {
+    RequestHeader requestHeader,
+    String endpointUrl,
+    ListOfLocaleId localeIds,
+    ListOfString profileUris
+  }
+
+  type record GetEndpointsResponse {
+    ResponseHeader responseHeader,
+    ListOfEndpointDescription Endpoints
+  }
+
+  type record RegisterServerRequest {
+    RequestHeader requestHeader,
+    RegisteredServer server
+  }
+
+  type record RegisterServerResponse {
+    ResponseHeader responseHeader
+  }
+
+  type record RegisterServer2Request {
+    RequestHeader requestHeader,
+    RegisteredServer server,
+    ListOfExtensibleParameter discoveryConfiguration
+  }
+
+  type record RegisterServer2Response {
+    ResponseHeader responseHeader,
+    ListOfStatusCode configurationResults,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //               SecureChannel Service Sets                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record OpenSecureChannelRequest {
+    RequestHeader requestHeader,
+    UInt32 clientProtocolVersion,
+    SecurityTokenRequestType requestType,
+    MessageSecurityMode securityMode,
+    ByteString clientNonce,
+    UInt32 requestedLifetime
+  }
+
+  type record OpenSecureChannelResponse {
+    ResponseHeader responseHeader,
+    UInt32 serverProtocolVersion,
+    ChannelSecurityToken securityToken,
+    ByteString serverNonce
+  }
+
+  type record CloseSecureChannelRequest {
+    RequestHeader requestHeader
+  }
+
+  type record CloseSecureChannelResponse {
+    ResponseHeader responseHeader
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                Session Service Sets                     //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record CreateSessionRequest {
+    RequestHeader requestHeader,
+    ApplicationDescription clientDescription,
+    String serverUri,
+    String endpointUrl,
+    String sessionName,
+    ByteString clientNonce,
+    ByteString clientCertificate,
+    Duration requestedSessionTimeout,
+    UInt32 maxResponseMessageSize
+  }
+
+  type record CreateSessionResponse {
+    ResponseHeader responseHeader,
+    NodeId sessionId,
+    SessionAuthenticationToken authenticationToken,
+    Duration revisedSessionTimeout,
+    ByteString serverNonce,
+    ByteString serverCertificate,
+    ListOfEndpointDescription serverEndpoints,
+    ListOfSignedSoftwareCertificate serverSoftwareCertificates,
+    SignatureData serverSignature,
+    UInt32 maxRequestMessageSize
+  }
+
+  type record ActivateSessionRequest {
+    RequestHeader requestHeader,
+    SignatureData clientSignature,
+    ListOfSignedSoftwareCertificate clientSoftwareCertificates,
+    ListOfLocaleId localeIds,
+    ExtensibleParameter userIdentityToken,
+    SignatureData userTokenSignature
+  }
+
+  type record ActivateSessionResponse {
+    ResponseHeader responseHeader,
+    ByteString serverNonce,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record CloseSessionRequest {
+    RequestHeader requestHeader,
+    Boolean deleteSubscriptions
+  }
+
+  type record CloseSessionResponse {
+    ResponseHeader responseHeader
+  }
+
+  type record CancelRequestRequest {
+    RequestHeader requestHeader,
+    IntegerId requestHandle
+  }
+
+  type record CancelRequestResponse {
+    ResponseHeader responseHeader,
+    UInt32 cancelCount
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //              NodeManagement Service Sets                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record AddNodesRequest {
+    RequestHeader requestHeader,
+    ListOfAddNodesItem nodesToAdd
+  }
+
+  type record AddNodesResponse {
+    ResponseHeader responseHeader,
+    ListOfAddNodesResult results
+  }
+
+  type record AddReferencesRequest {
+    RequestHeader requestHeader,
+    ListOfAddReferencesItem referencesToAdd
+  }
+
+  type record AddReferencesResponse {
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record DeleteNodesRequest {
+    RequestHeader requestHeader,
+    ListOfDeleteNodesItem nodesToDelete
+  }
+
+  type record DeleteNodesResponse {
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record DeleteReferencesRequest {
+    RequestHeader requestHeader,
+    ListOfDeleteReferencesItem referencesToDelete
+  }
+
+  type record DeleteReferencesResponse {
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Browse Service Sets                     //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record BrowseRequest {
+    RequestHeader requestHeader,
+    ViewDescription view,
+    Counter requestedMaxReferencesPerNode,
+    ListOfBrowseDescription nodesToBrowse
+  }
+
+  type record BrowseResponse {
+    ResponseHeader responseHeader,
+    ListOfBrowseResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record BrowseNextRequest {
+    RequestHeader requestHeader,
+    Boolean releaseContinuationPoints,
+    ListOfContinuationPoint continuationPoints
+  }
+
+  type record BrowseNextResponse {
+    ResponseHeader responseHeader,
+    ListOfBrowseResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record TranslateBrowsePathsToNodeIdsRequest {
+    RequestHeader requestHeader,
+    ListOfBrowsePath browsePaths
+  }
+
+  type record TranslateBrowsePathsToNodeIdsResponse {
+    ResponseHeader responseHeader,
+    ListOfBrowsePathResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record RegisterNodesRequest {
+    RequestHeader requestHeader,
+    ListOfNodeId nodesToRegister
+  }
+
+  type record RegisterNodesResponse {
+    ResponseHeader responseHeader,
+    ListOfNodeId registeredNodeIds
+  }
+
+  type record UnregisterNodesRequest {
+    RequestHeader requestHeader,
+    ListOfNodeId nodesToUnregister
+  }
+
+  type record UnregisterNodesResponse {
+    ResponseHeader responseHeader
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Query Service Set                       //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record QueryFirstRequest {
+    RequestHeader requestHeader,
+    ListOfNodeTypeDescription nodeTypes,
+    ContentFilter filter,
+    Counter maxDataSetsToReturn,
+    Counter maxReferencesToReturn
+  }
+
+  type record QueryFirstResponse {
+    ResponseHeader responseHeader,
+    ListOfQueryDataSet queryDataSets,
+    ContinuationPoint continuationPoint,
+    ListOfParsingResult parsingResults,
+    ListOfDiagnosticInfo diagnosticInfos,
+    ContentFilterResult filterResult
+  }
+
+  type record QueryNextRequest {
+    RequestHeader requestHeader,
+    Boolean releaseContinuationPoint,
+    ContinuationPoint continuationPoint
+  }
+
+  type record QueryNextResponse {
+    ResponseHeader responseHeader,
+    ListOfQueryDataSet queryDataSets,
+    ContinuationPoint revisedContinuationPoint
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                Attribute Service Set                    //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record ReadRequest {
+    RequestHeader requestHeader,
+    Duration maxAge,
+    TimestampsToReturn timestampsToReturn,
+    ListOfReadValueId nodesToRead
+  }
+
+  type record ReadResponse {
+    ResponseHeader responseHeader,
+    ListOfDataValue results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record HistoryReadRequest {
+    RequestHeader requestHeader,
+    ExtensibleParameter historyReadDetails,
+    TimestampsToReturn timestampsToReturn,
+    Boolean releaseContinuationPoints,
+    ListOfHistoryReadValueId nodesToRead
+  }
+
+  type record HistoryReadResponse {
+    ResponseHeader responseHeader,
+    ListOfHistoryReadResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record WriteRequest {
+    RequestHeader requestHeader,
+    ListOfWriteValue nodesToWrite
+  }
+
+  type record WriteResponse {
+    ResponseHeader responseHeader,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record HistoryUpdateRequest {
+    RequestHeader requestHeader,
+    ListOfExtensibleParameter historyUpdateDetails
+  }
+
+  type record HistoryUpdateResponse {
+    ResponseHeader responseHeader,
+    ListOfHistoryUpdateResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                   Method Service Set                    //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record CallRequest {
+    RequestHeader requestHeader,
+    ListOfCallMethodRequest methodsToCall
+  }
+
+  type record CallResponse {
+    ResponseHeader responseHeader,
+    ListOfCallMethodResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                MonitoredItem Service Set                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record CreateMonitoredItemsRequest {
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    TimestampsToReturn timestampsToReturn,
+    ListOfMonitoredItemCreateRequest itemsToCreate
+  }
+
+  type record CreateMonitoredItemsResponse {
+    ResponseHeader responseHeader,
+    ListOfMonitoredItemCreateResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record ModifyMonitoredItemsRequest {
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    TimestampsToReturn timestampsToReturn,
+    ListOfMonitoredItemModifyRequest itemsToModify
+  }
+
+  type record ModifyMonitoredItemsResponse {
+    ResponseHeader responseHeader,
+    ListOfMonitoredItemModifyResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record SetMonitoringModeRequest {
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    MonitoringMode monitoringMode,
+    ListOfIntegerId monitoredItemIds
+  }
+
+  type record SetMonitoringModeResponse {
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record SetTriggeringRequest {
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    IntegerId triggeringItemId,
+    ListOfIntegerId linksToAdd,
+    IntegerId linksToRemove
+  }
+
+  type record SetTriggeringResponse {
+    ResponseHeader responseHeader,
+    ListOfStatusCode addResults,
+    ListOfDiagnosticInfo addDiagnosticInfos,
+    ListOfStatusCode removeResults,
+    ListOfDiagnosticInfo removeDiagnosticInfos
+  }
+
+  type record DeleteMonitoredItemsRequest {
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    ListOfIntegerId monitoredItemIds
+  }
+
+  type record DeleteMonitoredItemsResponse {
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                Subscription  Service Set                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record CreateSubscriptionRequest {
+    RequestHeader requestHeader,
+    Duration requestedPublishingInterval,
+    Counter requestedLifetimeCount,
+    Counter requestedMaxKeepAliveCount,
+    Counter maxNotificationsPerPublish,
+    Boolean publishingEnabled,
+    Byte priorityInt32
+  }
+
+  type record CreateSubscriptionResponse {
+    ResponseHeader responseHeader,
+    IntegerId subscriptionId,
+    Duration revisedPublishingInterval,
+    Counter revisedLifetimeCount,
+    Counter revisedMaxKeepAliveCount
+  }
+
+  type record ModifySubscriptionRequest {
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    Duration requestedPublishingInterval,
+    Counter requestedLifetimeCount,
+    Counter requestedMaxKeepAliveCount,
+    Counter maxNotificationsPerPublish,
+    Byte priority
+  }
+
+  type record ModifySubscriptionResponse {
+    ResponseHeader responseHeader,
+    Duration revisedPublishingInterval,
+    Counter revisedLifetimeCount,
+    Counter revisedMaxKeepAliveCount
+  }
+
+  type record SetPublishingModeRequest {
+    RequestHeader requestHeader,
+    Boolean publishingEnabled,
+    ListOfIntegerId subscriptionIds
+  }
+
+  type record SetPublishingModeResponse {
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record PublishRequest {
+    RequestHeader requestHeader,
+    ListOfSubscriptionAcknowledgement subscriptionAcknowledgements
+  }
+
+  type record PublishResponse {
+    ResponseHeader responseHeader,
+    IntegerId subscriptionId,
+    ListOfCounter availableSequenceNumbers,
+    Boolean moreNotifications,
+    NotificationMessage notificationMessage,
+    //NotificationMessage notificationMessage, //!!
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record RepublishRequest {
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    Counter retransmitSequenceNumber
+  }
+
+  type record RepublishResponse {
+    ResponseHeader responseHeader,
+    NotificationMessage notificationMessage
+  }
+
+  type record TransferSubscriptionsRequest {
+    RequestHeader requestHeader,
+    ListOfIntegerId subscriptionIds,
+    Boolean sendInitialValues
+  }
+
+  type record TransferSubscriptionsResponse {
+    ResponseHeader responseHeader,
+    ListOfTransferResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record DeleteSubscriptionsRequest {
+    RequestHeader requestHeader,
+    ListOfIntegerId subscriptionIds
+  }
+
+  type record DeleteSubscriptionsResponse {
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                Session-less Service                     //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record SessionlessInvokeRequest {
+    VersionTime urisVersion,
+    ListOfString namespaceUris,
+    ListOfString serverUris,
+    ListOfLocaleId localeIds,
+    UInt32 serviceId,
+    SessionlessServices body
+  }
+
+  type record SessionlessInvokeResponse {
+    ListOfString namespaceUris,
+    ListOfString serverUris,
+    UInt32 serviceId,
+    SessionlessServices body
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                     Main Types                          //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type Int32 DataType;
+  type Variant BaseDataType;
+
+  type record of BaseDataType ListOfBaseDataType;
+
+  type union ServiceList {
+    //DiscoveryServices
+    FindServiceRequest FindServiceRequest,
+    FindServiceResponse FindServiceResponse,
+    FindServersOnNetworkRequest FindServersOnNetworkRequest,
+    FindServersOnNetworkResponse FindServersOnNetworkResponse,
+    GetEndpointsRequest GetEndpointsRequest,
+    GetEndpointsResponse GetEndpointsResponse,
+    RegisterServerRequest RegisterServerRequest,
+    RegisterServerResponse RegisterServerResponse,
+    RegisterServer2Request RegisterServer2Request,
+    RegisterServer2Response RegisterServer2Response,
+
+    //Secure Channel services
+    OpenSecureChannelRequest OpenSecureChannelRequest,
+    OpenSecureChannelResponse OpenSecureChannelResponse,
+    CloseSecureChannelRequest CloseSecureChannelRequest,
+    CloseSecureChannelResponse CloseSecureChannelResponse,
+
+    //Session Services
+    CreateSessionRequest CreateSessionRequest,
+    CreateSessionResponse CreateSessionResponse,
+    ActivateSessionRequest ActivateSessionRequest,
+    ActivateSessionResponse ActivateSessionResponse,
+    CloseSessionRequest CloseSessionRequest,
+    CloseSessionResponse CloseSessionResponse,
+    CancelRequestRequest CancelRequestRequest,
+    CancelRequestResponse CancelRequestResponse,
+
+    //Node Management Services
+    AddNodesRequest AddNodesRequest,
+    AddNodesResponse AddNodesResponse,
+    AddReferencesRequest AddReferencesRequest,
+    AddReferencesResponse AddReferencesResponse,
+    DeleteNodesRequest DeleteNodesRequest,
+    DeleteNodesResponse DeleteNodesResponse,
+    DeleteReferencesRequest DeleteReferencesRequest,
+    DeleteReferencesResponse DeleteReferencesResponse,
+
+    //View Services
+    BrowseRequest BrowseRequest,
+    BrowseResponse BrowseResponse,
+    BrowseNextRequest BrowseNextRequest,
+    BrowseNextResponse BrowseNextResponse,
+    TranslateBrowsePathsToNodeIdsRequest TranslateBrowsePathsToNodeIdsRequest,
+    TranslateBrowsePathsToNodeIdsResponse TranslateBrowsePathsToNodeIdsResponse,
+    RegisterNodesRequest RegisterNodesRequest,
+    RegisterNodesResponse RegisterNodesResponse,
+    UnregisterNodesRequest UnregisterNodesRequest,
+    UnregisterNodesResponse UnregisterNodesResponse,
+
+    //Query Services
+    QueryFirstRequest QueryFirstRequest,
+    QueryFirstResponse QueryFirstResponse,
+    QueryNextRequest QueryNextRequest,
+    QueryNextResponse QueryNextResponse,
+
+    //Attribute Services
+    ReadRequest ReadRequest,
+    ReadResponse ReadResponse,
+    HistoryReadRequest HistoryReadRequest,
+    HistoryReadResponse HistoryReadResponse,
+    WriteRequest WriteRequest,
+    WriteResponse WriteResponse,
+
+    //Method Services
+    HistoryUpdateRequest HistoryUpdateRequest,
+    HistoryUpdateResponse HistoryUpdateResponse,
+    CallRequest CallRequest,
+    CallResponse CallResponse,
+
+    //Monitored Item Services
+    CreateMonitoredItemsRequest CreateMonitoredItemsRequest,
+    CreateMonitoredItemsResponse CreateMonitoredItemsResponse,
+    ModifyMonitoredItemsRequest ModifyMonitoredItemsRequest,
+    ModifyMonitoredItemsResponse ModifyMonitoredItemsResponse,
+    SetMonitoringModeRequest SetMonitoringModeRequest,
+    SetMonitoringModeResponse SetMonitoringModeResponse,
+    SetTriggeringRequest SetTriggeringRequest,
+    SetTriggeringResponse SetTriggeringResponse,
+    DeleteMonitoredItemsRequest DeleteMonitoredItemsRequest,
+    DeleteMonitoredItemsResponse DeleteMonitoredItemsResponse,
+
+    //Subscription Services
+    CreateSubscriptionRequest CreateSubscriptionRequest,
+    CreateSubscriptionResponse CreateSubscriptionResponse,
+    ModifySubscriptionRequest ModifySubscriptionRequest,
+    ModifySubscriptionResponse ModifySubscriptionResponse,
+    SetPublishingModeRequest SetPublishingModeRequest,
+    SetPublishingModeResponse SetPublishingModeResponse,
+    PublishRequest PublishRequest,
+    PublishResponse PublishResponse,
+    RepublishRequest RepublishRequest,
+    RepublishResponse RepublishResponse,
+    TransferSubscriptionsRequest TransferSubscriptionsRequest,
+    TransferSubscriptionsResponse TransferSubscriptionsResponse,
+    DeleteSubscriptionsRequest DeleteSubscriptionsRequest,
+    DeleteSubscriptionsResponse DeleteSubscriptionsResponse
+  } with {
+    variant "";
+  }
+
+  type union SessionlessServices {
+    //Sessionless Invoke Services
+    //SessionlessInvokeRequest SessionlessInvokeRequest,
+    SessionlessInvokeResponse  SessionlessInvokeResponse,
+
+    ReadRequest readRequest,
+    ReadResponse readResponse,
+    WriteRequest writeRequest,
+    WriteResponse writeResponse,
+    CallRequest callRequest,
+    CallResponse callResponse
+  } with {
+    variant "";
+  }
+
+  type union OpcMessages {
+    HelloMessage helloMessage,
+    AckMessage ackMessage,
+    ErrorMessage errorMessage,
+    ReverseHelloMessage reverseHelloMessage
+  } with {
+    variant "";
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                    Encoded Types                        //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  //An OPC Message we recivie. Contains headers, and an encoded body.
+  //If the message is not a whole msg, you can chain the encoded body's together, and decode it when you have
+  //the full msg
+  type record MessageChunk {
+    MessageHeader header,
+    OpcMessages transportMessage optional,  //Transport Messages (Hello, Ack, ...)
+    UInt32 securityChannelId optional,  //OpenSecureChannel, CloseSecureChannel or Services
+    ListOfByte securePolicyUri optional,  //OpenSecureChannel
+    ListOfByte senderCertificate optional, //OpenSecureChannel
+    ListOfByte receiverCertificateThumbprint optional, //OpenSecureChannel
+    UInt32 securityTokenId optional, //Services or CloseSecureChannel
+    SequenceHeader sequenceHeader optional, //OpenSecureChannel, or Services
+    octetstring body optional //OpenSecureChannel, CloseSecureChannel or Services
+    //TODO: Add footer when security is implemented
+  } with {
+    variant (transportMessage) "PRESENCE(header.messageType = HelloHeaderMsgType,
+                                         header.messageType = AckHeaderMsgType,
+                                         header.messageType = ErrorHeaderMsgType,
+                                         header.messageType = ReverseHelloHeaderMsgType)"
+
+    variant (securityChannelId) "PRESENCE(header.messageType = ServicesMsgType,
+                                          header.messageType = CloseSecureChannelMsgType,
+                                          header.messageType = OpenSecureChannelMsgType)"
+
+    variant (securePolicyUri) "PRESENCE(header.messageType = OpenSecureChannelMsgType)"
+    variant (senderCertificate) "PRESENCE(header.messageType = OpenSecureChannelMsgType)"
+    variant (receiverCertificateThumbprint) "PRESENCE(header.messageType = OpenSecureChannelMsgType)"
+
+    variant (securityTokenId) "PRESENCE(header.messageType = ServicesMsgType,
+                                        header.messageType = CloseSecureChannelMsgType)"
+
+    variant (sequenceHeader) "PRESENCE(header.messageType = ServicesMsgType,
+                                          header.messageType = CloseSecureChannelMsgType,
+                                          header.messageType = OpenSecureChannelMsgType)"
+
+    variant (transportMessage)"CROSSTAG(helloMessage, header.messageType = HelloHeaderMsgType;
+                                        ackMessage, header.messageType = AckHeaderMsgType;
+                                        errorMessage, header.messageType = ErrorHeaderMsgType;
+                                        reverseHelloMessage, header.messageType = ReverseHelloHeaderMsgType)";
+
+    //TODO: Fix length encoding
+    variant (header) "LENGTHTO(header, transportMessage, securityChannelId, securePolicyUri, senderCertificate, receiverCertificateThumbprint, securityTokenId, sequenceHeader, body)"
+    variant (header) "LENGTHINDEX(messageSize)"
+  }
+
+  //The message body
+  type record ServiceBody {
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+    ServiceList list
+  } with {
+    variant (list)"CROSSTAG( FindServiceRequest,  nodeValue = 0;     //No data in XML
+                             FindServiceResponse,  nodeValue = 1;    //No data in XML
+                             CloseSecureChannelRequest, nodeValue = 452;
+                             CloseSecureChannelResponse, nodeValue = 455;
+                             OpenSecureChannelRequest, nodeValue = 446;
+                             OpenSecureChannelResponse, nodeValue = 449;
+                             FindServersOnNetworkRequest,  nodeValue = 12208;
+                             FindServersOnNetworkResponse,  nodeValue = 12209;
+                             GetEndpointsRequest,  nodeValue = 428;
+                             GetEndpointsResponse,  nodeValue = 431;
+                             RegisterServerRequest,  nodeValue = 437;
+                             RegisterServerResponse,  nodeValue = 440;
+                             RegisterServer2Request,  nodeValue = 12211;
+                             RegisterServer2Response,  nodeValue = 12212;
+                             CreateSessionRequest,  nodeValue = 461;
+                             CreateSessionResponse,  nodeValue = 464;
+                             ActivateSessionRequest,  nodeValue = 467;
+                             ActivateSessionResponse,  nodeValue = 470;
+                             CloseSessionRequest,  nodeValue = 473;
+                             CloseSessionResponse,  nodeValue = 476;
+                             CancelRequestRequest,  nodeValue = 479;
+                             CancelRequestResponse,  nodeValue = 482;
+                             AddNodesRequest,  nodeValue = 488;
+                             AddNodesResponse,  nodeValue = 491;
+                             AddReferencesRequest,  nodeValue = 494;
+                             AddReferencesResponse,  nodeValue = 497;
+                             DeleteNodesRequest,  nodeValue = 500;
+                             DeleteNodesResponse,  nodeValue = 503;
+                             DeleteReferencesRequest,  nodeValue = 506;
+                             DeleteReferencesResponse,  nodeValue = 509;
+                             BrowseRequest,  nodeValue = 527;
+                             BrowseResponse,  nodeValue = 530;
+                             BrowseNextRequest,  nodeValue = 533;
+                             BrowseNextResponse,  nodeValue = 536;
+                             TranslateBrowsePathsToNodeIdsRequest,  nodeValue = 554;
+                             TranslateBrowsePathsToNodeIdsResponse,  nodeValue = 557;
+                             RegisterNodesRequest,  nodeValue = 560;
+                             RegisterNodesResponse,  nodeValue = 563;
+                             UnregisterNodesRequest,  nodeValue = 566;
+                             UnregisterNodesResponse,  nodeValue = 569;
+                             QueryFirstRequest,  nodeValue = 615;
+                             QueryFirstResponse,  nodeValue = 618;
+                             QueryNextRequest,  nodeValue = 621;
+                             QueryNextResponse,  nodeValue = 624;
+                             ReadRequest,  nodeValue = 631;
+                             ReadResponse,  nodeValue = 634;
+                             HistoryReadRequest,  nodeValue = 664;
+                             HistoryReadResponse,  nodeValue = 667;
+                             WriteRequest,  nodeValue = 673;
+                             WriteResponse,  nodeValue = 677;
+                             HistoryUpdateRequest,  nodeValue = 700;
+                             HistoryUpdateResponse,  nodeValue = 703;
+                             CallRequest,  nodeValue = 712;
+                             CallResponse,  nodeValue = 715;
+                             CreateMonitoredItemsRequest,  nodeValue = 751;
+                             CreateMonitoredItemsResponse,  nodeValue = 754;
+                             ModifyMonitoredItemsRequest,  nodeValue = 763;
+                             ModifyMonitoredItemsResponse,  nodeValue = 766;
+                             SetMonitoringModeRequest,  nodeValue = 769;
+                             SetMonitoringModeResponse,  nodeValue = 772;
+                             SetTriggeringRequest,  nodeValue = 775;
+                             SetTriggeringResponse,  nodeValue = 778;
+                             DeleteMonitoredItemsRequest,  nodeValue = 781;
+                             DeleteMonitoredItemsResponse,  nodeValue = 784;
+                             CreateSubscriptionRequest,  nodeValue = 787;
+                             CreateSubscriptionResponse,  nodeValue = 790;
+                             ModifySubscriptionRequest,  nodeValue = 793;
+                             ModifySubscriptionResponse,  nodeValue = 796;
+                             SetPublishingModeRequest,  nodeValue = 799;
+                             SetPublishingModeResponse,  nodeValue = 802;
+                             PublishRequest,  nodeValue = 826;
+                             PublishResponse,  nodeValue = 829;
+                             RepublishRequest,  nodeValue = 832;
+                             RepublishResponse,  nodeValue = 835;
+                             TransferSubscriptionsRequest,  nodeValue = 841;
+                             TransferSubscriptionsResponse,  nodeValue = 844;
+                             DeleteSubscriptionsRequest,  nodeValue = 847;
+                             DeleteSubscriptionsResponse,  nodeValue = 850)";
+  }
+
+} with { encode "RAW" }
diff --git a/src/OpcUa_Types_JSON_Non_Reversible.ttcn b/src/OpcUa_Types_JSON_Non_Reversible.ttcn
new file mode 100644
index 0000000..49efa6a
--- /dev/null
+++ b/src/OpcUa_Types_JSON_Non_Reversible.ttcn
@@ -0,0 +1,3442 @@
+/////////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2017  Ericsson AB
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+/////////////////////////////////////////////////////////////////////////////////////
+// Contributors:
+// Akos Makovics
+//
+//  File:         OpcUa_Types_JSON_Non_Reversible.ttcn
+//  Rev:          R1A
+//  Prodnr:       CNL
+/////////////////////////////////////////////////////////////////////////////////////
+
+module OpcUa_Types_JSON_Non_Reversible
+{
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Encoders and Decoders                   //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  external function enc_MessageTypes (in MessageTypes msg) return octetstring
+    with { extension "prototype(convert) encode(JSON)" }
+
+  external function dec_MessageTypes (in octetstring p_oct, out MessageTypes msg) return integer
+    with {extension "prototype(backtrack) decode (JSON) errorbehavior(ALL:WARNING)"}
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                     Constant Values                     //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  const integer Null_Value := -2147483647;
+
+  const integer HelloHeaderMsgType := 4998472;
+  const integer AckHeaderMsgType := 4932417;
+  const integer ErrorHeaderMsgType := 5395013;
+  const integer ReverseHelloHeaderMsgType := 4540498;
+
+  const integer OpenSecureChannelMsgType := 5132367;
+  const integer CloseSecureChannelMsgType := 5196867;
+  const integer ServicesMsgType := 4674381;
+
+  const integer FindServiceRequestNodeId := 0; //No data in XML
+  const integer FindServiceResponseNodeId := 1; //No data in XML
+  const integer CloseSecureChannelRequestNodeId := 450;
+  const integer CloseSecureChannelResponseNodeId := 453;
+  const integer OpenSecureChannelRequestNodeId := 444;
+  const integer OpenSecureChannelResponseNodeId := 447;
+  const integer FindServersOnNetworkRequestNodeId := 12208;
+  const integer FindServersOnNetworkResponseNodeId := 12209;
+  const integer GetEndpointsRequestNodeId := 426;
+  const integer GetEndpointsResponseNodeId := 429;
+  const integer RegisterServerRequestNodeId := 435;
+  const integer RegisterServerResponseNodeId := 438;
+  const integer RegisterServer2RequestNodeId := 12211;
+  const integer RegisterServer2ResponseNodeId := 12212;
+  const integer CreateSessionRequestNodeId := 459;
+  const integer CreateSessionResponseNodeId := 462;
+  const integer ActivateSessionRequestNodeId := 465;
+  const integer ActivateSessionResponseNodeId := 468;
+  const integer CloseSessionRequestNodeId := 471;
+  const integer CloseSessionResponseNodeId := 474;
+  const integer CancelRequestRequestNodeId := 477;
+  const integer CancelRequestResponseNodeId := 480;
+  const integer AddNodesRequestNodeId := 486;
+  const integer AddNodesResponseNodeId := 489;
+  const integer AddReferencesRequestNodeId := 492;
+  const integer AddReferencesResponseNodeId := 495;
+  const integer DeleteNodesRequestNodeId := 488;
+  const integer DeleteNodesResponseNodeId := 501;
+  const integer DeleteReferencesRequestNodeId := 504;
+  const integer DeleteReferencesResponseNodeId := 507;
+  const integer BrowseRequestNodeId := 525;
+  const integer BrowseResponseNodeId := 528;
+  const integer BrowseNextRequestNodeId := 531;
+  const integer BrowseNextResponseNodeId := 534;
+  const integer TranslateBrowsePathsToNodeIdsRequestNodeId := 552;
+  const integer TranslateBrowsePathsToNodeIdsResponseNodeId := 555;
+  const integer RegisterNodesRequestNodeId := 558;
+  const integer RegisterNodesResponseNodeId := 561;
+  const integer UnregisterNodesRequestNodeId := 564;
+  const integer UnregisterNodesResponseNodeId := 567;
+  const integer QueryFirstRequestNodeId := 613;
+  const integer QueryFirstResponseNodeId := 616;
+  const integer QueryNextRequestNodeId := 619;
+  const integer QueryNextResponseNodeId := 622;
+  const integer ReadRequestNodeId := 629;
+  const integer ReadResponseNodeId := 632;
+  const integer HistoryReadRequestNodeId := 662;
+  const integer HistoryReadResponseNodeId := 665;
+  const integer WriteRequestNodeId := 671;
+  const integer WriteResponseNodeId := 675;
+  const integer HistoryUpdateRequestNodeId := 698;
+  const integer HistoryUpdateResponseNodeId := 701;
+  const integer CallRequestNodeId := 710;
+  const integer CallResponseNodeId := 713;
+  const integer CreateMonitoredItemsRequestNodeId := 749;
+  const integer CreateMonitoredItemsResponseNodeId := 752;
+  const integer ModifyMonitoredItemsRequestNodeId := 761;
+  const integer ModifyMonitoredItemsResponseNodeId := 764;
+  const integer SetMonitoringModeRequestNodeId := 767;
+  const integer SetMonitoringModeResponseNodeId := 770;
+  const integer SetTriggeringRequestNodeId := 773;
+  const integer SetTriggeringResponseNodeId := 776;
+  const integer DeleteMonitoredItemsRequestNodeId := 779;
+  const integer DeleteMonitoredItemsResponseNodeId := 782;
+  const integer CreateSubscriptionRequestNodeId := 785;
+  const integer CreateSubscriptionResponseNodeId := 789;
+  const integer ModifySubscriptionRequestNodeId := 791;
+  const integer ModifySubscriptionResponseNodeId := 794;
+  const integer SetPublishingModeRequestNodeId := 797;
+  const integer SetPublishingModeResponseNodeId := 800;
+  const integer PublishRequestNodeId := 824;
+  const integer PublishResponseNodeId := 827;
+  const integer RepublishRequestNodeId := 830;
+  const integer RepublishResponseNodeId := 833;
+  const integer TransferSubscriptionsRequestNodeId := 839;
+  const integer TransferSubscriptionsResponseNodeId := 842;
+  const integer DeleteSubscriptionsRequestNodeId := 845;
+  const integer DeleteSubscriptionsResponseNodeId := 848;
+
+  const integer FinalChunk := 70;
+  const integer IntermediateChunk := 67;
+  const integer ErrorChunk := 65;
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                     Enumerations                        //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type enumerated MessageSecurityMode {
+    INVALID_0,
+    NONE_1,
+    SIGN_2,
+    SIGNANDENCRYPT_3
+  }
+
+  type enumerated SecurityTokenRequestType {
+    ISSUE_0,
+    RENEW_1
+  }
+
+  type enumerated NodeClass
+  {
+    UNSPECIFIED_0(0),
+    OBJECT_1(1),
+    VARIABLE_2(2),
+    METHOD_4(4),
+    OBJECT_TYPE_8(8),
+    VARIABLE_TYPE_16(16),
+    REFERENCE_TYPE_32(32),
+    DATA_TYPE_64(64),
+    VIEW_128(128)
+  }
+
+  type enumerated StructureType {
+    STRUCTURE_0,
+    STRUCTURE_WITH_OPTIONAL_FIELDS_1,
+    UNION_2
+  }
+
+  type enumerated ApplicationType {
+    SERVER_0,
+    CLIENT_1,
+    CLIENTANDSERVER_2,
+    DISCOVERYSERVER_3
+  }
+
+  type enumerated DataChangeTrigger {
+    STATUS_0,
+    STATUS_VALUE_1,
+    STATUS_VALUE_TIMESTAMP_2
+  }
+
+  type enumerated MonitoringMode {
+    DISABLED_0,
+    SAMPLING_1,
+    REPORTING_2
+  }
+
+  type enumerated BrowseDirection {
+    FORWARD_0,
+    INVERSE_1,
+    BOTH_2
+  }
+
+  type enumerated TimestampsToReturn {
+    SOURCE_0,
+    SERVER_1,
+    BOTH_2,
+    NEITHER_3
+  }
+
+  type enumerated UserIdentityTokenType {
+    ANONYMOUS_0,
+    USERNAME_1,
+    CERTIFICATE_2,
+    ISSUEDTOKEN_3
+  }
+
+  type enumerated PerformUpdateType {
+    INSERT_1(1),
+    REPLACE_2(2),
+    UPDATE_3(3)
+  }
+
+  type enumerated PerformUpdateTypeExtended {
+    INSERT_1(1),
+    REPLACE_2(2),
+    UPDATE_3(3),
+    REMOVE_4(4)
+  }
+
+  type enumerated IdType
+  {
+    NUMERIC_0,
+    STRING_1,
+    GUID_2,
+    OPAQUE_3
+  }
+
+  type enumerated FilterOperator {
+    Equals_0,
+    IsNull_1,
+    GreaterThan_2,
+    LessThan_3,
+    GreaterThanOrEqual_4,
+    LessThanOrEqual_5,
+    Like_6,
+    Not_7,
+    Between_8,
+    InList_9,
+    And_10,
+    Or_11,
+    Cast_12,
+    InView_13,
+    OfType_14,
+    RelatedTo_15,
+    BitwiseAnd_16,
+    BitwiseOr_17
+  }
+
+  type enumerated OpenFileMode
+  {
+    READ_1(1),
+    WRITE_2(2),
+    ERASE_EXISTING_4(4),
+    APPEND_8(8)
+  }
+
+  type enumerated TrustListMasks
+  {
+    none_0(0),
+    trustedCertificates_1(1),
+    trustedCrls_2(2),
+    issuerCertificates_4(4),
+    issuerCrls_8(8),
+    all_15(15)
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                      Base Types                         //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  //Encoded as the JSON literal ‘true’ or ‘false’.
+  type boolean Boolean;
+
+  //An integer value between -128 and 127 inclusive.
+  type integer SByte with { variant "FIELDLENGTH(8), COMP(signbit), FIELDORDER(lsb)" };
+
+  //An integer value between 0 and 255 inclusive.
+  type integer Byte with { variant "FIELDLENGTH(8), COMP(nosign), FIELDORDER(lsb)" };
+
+  //An integer value between -32 768 and 32 767 inclusive.
+  type integer Int16 with { variant "FIELDLENGTH(16), COMP(signbit), FIELDORDER(lsb)" };
+
+  //An integer value between 0 and 65 535 inclusive.
+  type integer UInt16 with { variant "FIELDLENGTH(16), COMP(nosign), FIELDORDER(lsb)" };
+
+  //An integer value between 0 and 16 777 215
+  type integer UInt24 with { variant "FIELDLENGTH(24), COMP(nosign), FIELDORDER(lsb)" }
+
+  //An integer value between -2 147 483 648 and 2 147 483 647 inclusive.
+  type integer Int32 with { variant "FIELDLENGTH(32), COMP(signbit), FIELDORDER(lsb)" };
+
+  //An integer value between 0 and 4 294 967 295 inclusive.
+  type integer UInt32 with { variant "FIELDLENGTH(32), COMP(nosign), FIELDORDER(lsb)" };
+
+  //An integer value between -9 223 372 036 854 775 808 and 9 223 372 036 854 775 807 inclusive.
+  type charstring Int64 with { variant "FIELDLENGTH(64), COMP(signbit), FIELDORDER(lsb)" };
+
+  //An integer value between 0 and 18 446 744 073 709 551 615 inclusive.
+  type charstring UInt64 with { variant "FIELDLENGTH(64), COMP(nosign), FIELDORDER(lsb)" };
+
+  //An IEEE single precision (32 bit) floating point value.
+  type float Float with { variant "FORMAT(IEEE754 float), FIELDLENGTH(32), FIELDORDER(lsb)"};
+
+  //An IEEE double precision (64 bit) floating point value.
+  type float Double with { variant "FORMAT(IEEE754 double), FIELDLENGTH(64), FIELDORDER(lsb)"};
+
+  //Defines an interval of time in milliseconds
+  type Double Duration;
+
+  //Number of 100 nanosecond intervals since January 1, 1601
+  type charstring DateTime with { variant "FIELDLENGTH(64), COMP(signbit), BYTEORDER(first)"};
+
+  //Define Coordinated Universal Time (UTC) values.
+  type DateTime UtcTime;
+
+  //Represents the time in seconds since the year 2000. It is used as version number based on the last change time.
+  type UInt32 VersionTime;
+
+  //Represents the value of a counter
+  type UInt32 Counter;
+
+  //Identifies an element of an array
+  type UInt32 Index;
+
+  //Used as an identifier, such as a handle. All values, except for 0, are valid.
+  type UInt32 IntegerId;
+
+  //Representing an image.
+  type octetstring Image;
+
+  //Representing an image in BMP format.
+  type octetstring ImageBMP;
+
+  //Representing an image in GIF format.
+  type octetstring ImageGIF;
+
+  //Representing an image in JPG format.
+  type octetstring ImageJPG;
+
+  //Representing an image in PNG format.
+  type octetstring ImagePNG;
+
+  //Representing audio data. It can be any number of audio formats.
+  type ByteString AudioData;
+
+  //A string that is composed of a language component and a country/region component
+  type String LocaleId;
+
+  //Used to pause a Browse or QueryFirst operation
+  type ByteString ContinuationPoint;
+
+  //Used for indexing a range within an array
+  type String NumericRange;
+
+  //An opaque identifier that is used to identify requests associated with a particular Session.
+  type NodeId SessionAuthenticationToken;
+
+  //Sequence of UTF-8 characters without a null terminator and preceded by the length in bytes.
+  type charstring String;
+
+  //A 16-byte value that can be used as a globally unique identifier.
+  type charstring Guid;
+
+  //Sequence of bytes preceded by its length in bytes
+  type charstring ByteString
+
+  //An XML element, as an XML fragment serialized as UTF-8 string
+  type charstring XmlElement;
+
+  type Int32 DataType;
+  type Variant BaseDataType;
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                   Complex Types                         //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  //A StatusCode of Good (0) is treated like a NULL and not encoded. If it is an element of an JSON array it is encoded as the JSON literal ‘null’.
+  type record StatusCode {
+    integer Code,
+    String Symbol
+  }
+
+  //An identifier for a node in the address space of an OPC UA Server.
+  type record NodeId {
+    Byte IdType optional,
+    NodeIdType Id,
+    NodeIdNamsespace Namespace optional
+  } with {
+    variant (Id) "chosen (StringNodeId, IdType = 1;
+                          GuidNodeId, IdType = 2;
+                          ByteStringNodeId, IdType = 3;
+                          UInt32NodeId, otherwise;)"
+
+    variant(IdType) "JSON : default (0)"
+  }
+
+  type union NodeIdNamsespace {
+    integer IntNamespace,
+    String StringNamespace
+  } with {
+    variant "JSON: as value"
+  }
+
+  //Helper type, contains the possible body types for NodeId
+  type union NodeIdType {
+    UInt32 UInt32NodeId,
+    String StringNodeId,
+    Guid GuidNodeId,
+    ByteString ByteStringNodeId
+  } with {
+    variant "JSON: as value"
+  }
+
+  type record ExpandedNodeId {
+    Byte IdType optional,
+    NodeIdType Id,
+    NodeIdNamsespace Namespace optional,
+    String ServerURI optional
+  } with {
+    variant (Id) "chosen (StringNodeId, IdType = 1;
+                          GuidNodeId, IdType = 2;
+                          ByteStringNodeId, IdType = 3;
+                          UInt32NodeId, otherwise;)"
+
+    variant(IdType) "JSON : default (0)"
+  }
+
+  type record DiagnosticInfo {
+    Int32 SymbolicId,
+    Int32 NamespaceUri,
+    Int32 Locale,
+    Int32 LocalizedText,
+    String AdditionalInfo,
+    StatusCode InnerStatusCode optional,
+    DiagnosticInfo InnerDiagnosticInfo optional
+  }
+
+  //A name qualified by a namespace.
+  type record QualifiedName {
+    UInt16 namespaceIndex,
+    String name
+  }
+
+  //Human readable text with an optional locale identifier.
+  type record LocalizedText {
+    String locale,
+    String text
+  }
+
+  //A structure that contains an application specific data type that may not be recognized by the receiver
+  type record ExtensionObject {
+    ExtensionObjectBody body
+  }
+
+  type union ExtensionObjectBody {
+    octetstring structure,
+    String byteString,
+    String xmlElement
+  }
+
+  type record Variant {
+    VariantBody Body
+  }
+
+  type union VariantBody {
+    Boolean bool,
+    SByte sbyte,
+    Byte byte,
+    Int16 int16,
+    UInt16 uint16,
+    Int32 int32,
+    UInt32 uint32,
+    Int64 int64,
+    UInt64 uint64,
+    Float Float,
+    Double double,
+    String string,
+    DateTime datetime,
+    Guid guid,
+    ByteString bytestring,
+    XmlElement xmlelement,
+    NodeId nodeid,
+    ExpandedNodeId expandednodeid,
+    StatusCode statuscode,
+    QualifiedName qualifiedname,
+    LocalizedText localizedtext,
+    ExtensionObject extensionobject,
+    DataValue datavalue,
+    ListOfVariant listofvariant,
+    DiagnosticInfo diagnosticinfo,
+    ListOfBoolean listOfBool,
+    ListOfSByte listOfSbyte,
+    ListOfByte listOfByte,
+    ListOfInt16 listOfInt16,
+    ListOfUInt16 listOfUint16,
+    ListOfInt32 listOfInt32,
+    ListOfUInt32 listOfUint32,
+    ListOfInt64 listOfInt64,
+    ListOfUInt64 listOfUint64,
+    ListOfFloat listOfFloatValue,
+    ListOfDouble listOfDouble,
+    ListOfString listOfString,
+    ListOfDateTime listOfDatetime,
+    ListOfGuid listOfGuid,
+    ListOfByteString listOfBytestring,
+    ListOfXmlElement listOfXmlelement,
+    ListOfNodeId listOfNodeid,
+    ListOfExpandedNodeId listOfExpandednodeid,
+    ListOfStatusCode listOfStatuscode,
+    ListOfQualifiedName listOfQualifiedname,
+    ListOfLocalizedText listOfLocalizedtext,
+    ListOfExtensionObject listOfExtensionobject,
+    ListOfDataValue listOfDatavalue,
+    ListOfVariant listOfListofvariant,
+    ListOfDiagnosticInfo listOfDiagnosticinfo
+  }
+
+  type record DataValue {
+    integer EncodingMask,
+    Variant Value optional,
+    StatusCode Status optional,
+    DateTime SourceTimeStamp optional,
+    UInt16 SourcePicoSecond optional,
+    DateTime ServerTimestamp optional,
+    UInt16 ServerPicoSeconds optional
+  }
+
+  type record Decimal {
+    integer Scale,
+    String Value
+  }
+
+  //Represent a human-readable representation of an Enumeration.
+  type record EnumValueType {
+    Int64 Value,
+    LocalizedText displayName,
+    LocalizedText description
+  }
+
+  //Base DataType for all DataTypes representing a bit mask.
+  type record OptionSet {
+    ByteString Value,
+    ByteString validBits
+  }
+
+  //Provides the meta data for a custom Structure DataType.
+  type record StructureDefinition {
+    NodeId defaultEncodingId,
+    NodeId baseDataType,
+    StructureType structureType,
+    ListOfStructureField fields
+  }
+
+  //Provides the metadata for a custom Enumeration or OptionSet DataType.
+  type record EnumDefinition {
+    ListOfEnumField fields
+  }
+
+  //Provides the metadata for a field of a custom Enumeration or OptionSet DataType.
+  type record EnumField {
+    String name
+  }
+
+  //Provides the metadata for a field of a custom Structure DataType.
+  type record StructureField {
+    String name,
+    LocalizedText description,
+    NodeId dataType,
+    Int32 valueRank,
+    Boolean isOptional
+  }
+
+  //Implementation of the Extension Object for the Extensible Parameter types
+  type record ExtensibleParameter {
+    NodeId parameterTypeId,
+    ExtensibleParameterBody extensibleParameterBody optional
+  }
+
+  //Possible extension types
+  type union ExtensibleParameterBody {
+    ElementOperand elementOperand,
+    LiteralOperand literalOperand,
+    AttributeOperand attributeOperand,
+    SimpleAttributeOperand simpleAttributeOperand,
+    DataChangeFilter dataChangeFilter,
+    EventFilter eventFilter,
+    AggregateFilter aggregateFilter,
+    EventFilterResult eventFilterResult,
+    AggregateFilterResult aggregateFilterResult,
+    ObjectAttributes objectAttributes,
+    VariableAttributes variableAttributes,
+    MethodAttributes methodAttributes,
+    ObjectTypeAttributes objectTypeAttributes,
+    VariableTypeAttributes variableTypeAttributes,
+    ReferenceTypeAttributes referenceTypeAttributes,
+    DataTypeAttributes dataTypeAttributes,
+    ViewAttributes viewAttributes,
+    GenericAttributes genericAttributes,
+    UserNameIdentityToken userNameIdentityToken,
+    X509IdentityToken x509IdentityToken,
+    IssuedIdentityToken issuedIdentityToken,
+    AnonymousIdentityToken anonymousIdentityToken,
+    MdnsDiscoveryConfiguration mdnsDiscoveryConfiguration,
+    ReadEventDetails readEventDetails,
+    ReadRawModifiedDetails readRawModifiedDetails,
+    ReadProcessedDetails readProcessedDetails,
+    ReadAtTimeDetails readAtTimeDetails,
+    ListOfDataValue dataValues,
+    UpdateDataDetails updateDataDetails,
+    UpdateStructureDataDetails updateStructureDataDetails,
+    UpdateEventDetails updateEventDetails,
+    DeleteRawModifiedDetails deleteRawModifiedDetails,
+    DeleteAtTimeDetails deleteAtTimeDetails,
+    DeleteEventDetails deleteEventDetails,
+    DataChangeNotification dataChangeNotification,
+    EventNotificationList eventNotificationList,
+    StatusChangeNotification statusChangeNotification
+  } with {
+    variant "";
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Lists and Arrays                        //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  //Arrays of types. Used in lists, and in templates for lists
+  type record of Boolean ListOfBoolean;
+  type record of integer ListOfInteger;
+  type record of SByte ListOfSByte;
+  type record of Byte ListOfByte;
+  type record of Int16 ListOfInt16;
+  type record of UInt16 ListOfUInt16;
+  type record of Int32 ListOfInt32;
+  type record of UInt32 ListOfUInt32;
+  type record of Int64 ListOfInt64;
+  type record of UInt64 ListOfUInt64;
+  type record of Float ListOfFloat;
+  type record of Double ListOfDouble;
+  type record of DateTime ListOfDateTime;
+  type record of UtcTime ListOfUtcTime;
+  type record of Counter ListOfCounter;
+  type record of IntegerId ListOfIntegerId;
+  type record of LocaleId ListOfLocaleId;
+  type record of ContinuationPoint ListOfContinuationPoint;
+  type record of String ListOfString;
+  type record of Guid ListOfGuid;
+  type record of ByteString ListOfByteString;
+  type record of XmlElement ListOfXmlElement;
+  type record of NodeId ListOfNodeId;
+  type record of ExpandedNodeId ListOfExpandedNodeId;
+  type record of StatusCode ListOfStatusCode;
+  type record of DiagnosticInfo ListOfDiagnosticInfo;
+  type record of QualifiedName ListOfQualifiedName;
+  type record of LocalizedText ListOfLocalizedText;
+  type record of ExtensionObject ListOfExtensionObject;
+  type record of Variant ListOfVariant;
+  type record of DataValue ListOfDataValue;
+  type record of Decimal ListOfDecimal;
+  type record of EnumValueType ListOfEnumValueType;
+  type record of EnumField ListOfEnumField;
+  type record of StructureField ListOfStructureField;
+  type record of ExtensibleParameter ListOfExtensibleParameter;
+  type record of ApplicationDescription ListOfApplicationDescription;
+  type record of BrowseResult ListOfBrowseResult;
+  type record of ContentFilterElement ListOfContentFilterElement;
+  type record of ContentFilterElementResult ListOfContentFilterElementResult;
+  type record of SimpleAttributeOperand ListOfSimpleAttributeOperand;
+  type record of EndpointDescription ListOfEndpointDescription;
+  type record of MonitoringParameters ListOfMonitoringParameters;
+  type record of GenericAttributeValue ListOfGenericAttributeValue;
+  type record of MonitoredItemNotification ListOfMonitoredItemNotification;
+  type record of EventFieldList ListOfEventFieldList;
+  type record of QueryDataSet ListOfQueryDataSet;
+  type record of ReadValueId ListOfReadValueId;
+  type record of ReferenceDescription ListOfReferenceDescription;
+  type record of RelativePathElement ListOfRelativePathElement;
+  type record of ApplicationInstanceCertificate ListOfApplicationInstanceCertificate;
+  type record of ChannelSecurityToken ListOfChannelSecurityToken;
+  type record of UserTokenPolicy ListOfUserTokenPolicy;
+  type record of ServerOnNetwork ListOfServerOnNetwork;
+  type record of AddNodesItem ListOfAddNodesItem;
+  type record of AddNodesResult ListOfAddNodesResult;
+  type record of AddReferencesItem ListOfAddReferencesItem;
+  type record of DeleteNodesItem ListOfDeleteNodesItem;
+  type record of DeleteReferencesItem ListOfDeleteReferencesItem;
+  type record of SignedSoftwareCertificate ListOfSignedSoftwareCertificate;
+  type record of BrowseDescription ListOfBrowseDescription;
+  type record of BrowsePath ListOfBrowsePath;
+  type record of BrowsePathResult ListOfBrowsePathResult;
+  type record of BrowsePathTarget ListOfBrowsePathTarget;
+  type record of NodeTypeDescription ListOfNodeTypeDescription;
+  type record of QueryDataDescription ListOfQueryDataDescription;
+  type record of ParsingResult ListOfParsingResult;
+  type record of HistoryReadValueId ListOfHistoryReadValueId;
+  type record of HistoryReadResult ListOfHistoryReadResult;
+  type record of WriteValue ListOfWriteValue;
+  type record of HistoryUpdateResult ListOfHistoryUpdateResult;
+  type record of CallMethodRequest ListOfCallMethodRequest;
+  type record of CallMethodResult ListOfCallMethodResult;
+  type record of MonitoredItemCreateRequest ListOfMonitoredItemCreateRequest;
+  type record of MonitoredItemCreateResult ListOfMonitoredItemCreateResult;
+  type record of MonitoredItemModifyRequest ListOfMonitoredItemModifyRequest;
+  type record of MonitoredItemModifyResult ListOfMonitoredItemModifyResult;
+  type record of SubscriptionAcknowledgement ListOfSubscriptionAcknowledgement;
+  type record of TransferResult ListOfTransferResult;
+  type record of BaseDataType ListOfBaseDataType;
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                    Common Parameters                    //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  //Information that describes an application.
+  type record ApplicationDescription {
+    String applicationUri,
+    String productUri,
+    LocalizedText applicationName,
+    ApplicationType applicationType,
+    String gatewayServerUri,
+    String discoveryProfileUri,
+    ListOfString discoveryUrls
+  }
+
+  //Information that identified an application instance
+  type record ApplicationInstanceSubjectIdentifier {
+    String name
+  }
+
+  //Information that identified the issuer of an application instance
+  type record ApplicationInstanceIssuerIdentifier {
+    String productName ,
+    String organisation
+  }
+
+  type record BrowseResult {
+    StatusCode statusCode optional,
+    ContinuationPoint continuationPoint,
+    ListOfReferenceDescription References
+  }
+
+  type record ContentFilter {
+    ListOfContentFilterElement elements
+  }
+
+  type record ContentFilterElement {
+    FilterOperator filterOperator,
+    ListOfExtensibleParameter filterOperands
+  }
+
+  type record ContentFilterResult {
+    ListOfContentFilterElementResult elementResults,
+    ListOfDiagnosticInfo elementDiagnosticInfos
+  }
+
+  type record ContentFilterElementResult {
+    StatusCode statusCode optional,
+    ListOfStatusCode operandStatusCodes,
+    ListOfDiagnosticInfo operandDiagnosticInfos
+  }
+
+  type record ElementOperand {
+    UInt32 index
+  }
+
+  type record LiteralOperand {
+    BaseDataType Value
+  }
+
+  type record AttributeOperand {
+    NodeId nodeId,
+    String alias,
+    RelativePath browsePath,
+    IntegerId attributeId,
+    NumericRange indexRange
+  }
+
+  type record SimpleAttributeOperand {
+    NodeId typeId,
+    ListOfQualifiedName browsePath,
+    IntegerId attributeId,
+    NumericRange indexRange
+  }
+
+  type record MdnsDiscoveryConfiguration {
+    String mdnsServerName,
+    ListOfString serverCapabilities
+  }
+
+  type record EndpointDescription {
+    String endpointUrl,
+    ApplicationDescription server,
+    ByteString  serverCertificate,
+    MessageSecurityMode securityMode,
+    String securityPolicyUri,
+    ListOfUserTokenPolicy userIdentityTokens,
+    String transportProfileUri,
+    Byte securityLevel
+  }
+
+  type record MonitoringParameters {
+    IntegerId clientHandle,
+    Duration samplingInterval,
+    ExtensibleParameter filter,
+    Counter queueSize,
+    Boolean discardOldest
+  }
+
+  type record DataChangeFilter {
+    DataChangeTrigger Trigger,
+    UInt32 deadbandType,
+    Double deadbandValue
+  }
+
+  type record EventFilter {
+    ListOfSimpleAttributeOperand selectClauses,
+    ContentFilter whereClause
+  }
+
+  type record EventFilterResult {
+    ListOfStatusCode selectClauseResults,
+    ListOfDiagnosticInfo selectClauseDiagnosticInfos,
+    ContentFilterResult whereClauseResult
+  }
+
+  type record AggregateFilter {
+    UtcTime startTime,
+    NodeId aggregateType,
+    Duration processingInterval,
+    AggregateConfiguration aggregateConfiguration,
+    Boolean useServerCapabilitiesDefaults,
+    Boolean treatUncertainAsBad,
+    Byte percentDataBad,
+    Byte percentDataGood,
+    Boolean useSlopedExtrapolation
+  }
+
+  type record AggregateConfiguration {
+    Boolean TreatUncertainAsBad,
+    Boolean useSeverCapabilitiesDefaults,
+    Byte PercentDataBad,
+    Byte PercentDataGood,
+    Boolean UseSlopedExtrapolation
+  }
+
+  type record AggregateFilterResult {
+    UtcTime revisedStartTime,
+    Duration revisedProcessingInterval
+  }
+
+  type record ObjectAttributes {
+    integer EncodingMask,
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Byte eventNotifier optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  }
+
+  type record VariableAttributes {
+    integer EncodingMask,
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    DataType Value optional,
+    NodeId dataType optional,
+    Int32 valueRank optional,
+    ListOfUInt32 arrayDimensions optional,
+    Byte accessLevel optional,
+    Byte userAccessLevel optional,
+    Duration minimumSamplingInterval optional,
+    Boolean historizing optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  }
+
+  type record MethodAttributes {
+    integer EncodingMask,
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Boolean executable optional,
+    Boolean userExecutable optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  }
+
+  type record ObjectTypeAttributes {
+    integer EncodingMask,
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Boolean isAbstract optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  }
+
+  type record VariableTypeAttributes {
+    integer EncodingMask,
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    DataType Value optional,
+    NodeId dataType optional,
+    Int32 valueRank optional,
+    ListOfUInt32 arrayDimensions optional,
+    Boolean isAbstract optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  }
+
+  type record ReferenceTypeAttributes {
+    integer EncodingMask,
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Boolean isAbstract optional,
+    Boolean symmetric optional,
+    LocalizedText inverseName optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  }
+
+  type record DataTypeAttributes {
+    integer EncodingMask,
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Boolean isAbstract optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  }
+
+  type record ViewAttributes {
+    integer EncodingMask,
+    LocalizedText displayName optional,
+    LocalizedText description optional,
+    Boolean containsNoLoops optional,
+    Byte eventNotifier optional,
+    UInt32 writeMask optional,
+    UInt32 userWriteMask optional
+  }
+
+  type record GenericAttributes {
+    ListOfGenericAttributeValue attributeValues
+  }
+
+  type record GenericAttributeValue {
+    IntegerId attributeId,
+    BaseDataType Value
+  }
+
+  type record DataChangeNotification {
+    ListOfMonitoredItemNotification monitoredItems,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record MonitoredItemNotification {
+    IntegerId clientHandle,
+    DataValue Value
+  }
+
+  type record EventNotificationList {
+    ListOfEventFieldList events
+  }
+
+  type record EventFieldList {
+    IntegerId clientHandle,
+    ListOfBaseDataType eventFields
+  }
+
+  type record StatusChangeNotification {
+    StatusCode status optional,
+    DiagnosticInfo diagnosticInfo
+  }
+
+  type record NotificationMessage {
+    Counter sequenceNumber,
+    UtcTime publishTime,
+    ListOfExtensibleParameter notificationData
+  }
+
+  type record QueryDataSet {
+    ExpandedNodeId nodeId,
+    ExpandedNodeId typeDefinitionNode,
+    ListOfBaseDataType values
+  }
+
+  type record ReadValueId {
+    NodeId nodeId,
+    IntegerId attributeId,
+    NumericRange indexRange,
+    QualifiedName dataEncoding
+  }
+
+  type record ReferenceDescription {
+    NodeId referenceTypeId,
+    Boolean isForward,
+    ExpandedNodeId nodeId,
+    QualifiedName browseName,
+    LocalizedText displayName,
+    NodeClass nodeClass,
+    ExpandedNodeId typeDefinition
+  }
+
+  type record RelativePath {
+    ListOfRelativePathElement elements
+  }
+
+  type record RelativePathElement {
+    NodeId referenceTypeId,
+    Boolean isInverse,
+    Boolean includeSubtypes,
+    QualifiedName targetName
+  }
+
+  type record RegisteredServer {
+    String serverUri,
+    String productUri,
+    ListOfLocalizedText serverNames,
+    ApplicationType serverType,
+    String gatewayServerUri,
+    ListOfString discoveryUrls,
+    String semaphoreFilePath,
+    Boolean isOnline
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //         Structures for Security (Incomplete)            //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record ApplicationInstanceCertificate {
+    String version,
+    ByteString serialNumber,
+    String signatureAlgorithm,
+    ByteString Signature,
+    ApplicationInstanceIssuerIdentifier issuer,
+    UtcTime validFrom,
+    UtcTime validTo,
+    ApplicationInstanceSubjectIdentifier subject,
+    String applicationUri,
+    ListOfString hostnames,
+    ByteString publicKey,
+    ListOfString keyUsage
+  }
+
+  type record ChannelSecurityToken {
+    UInt32 channelId,
+    UInt32 tokenId,
+    UtcTime createdAt,
+    UInt32 revisedLifetime
+  }
+
+  type record EncryptedSecret {
+    NodeId TypeId,
+    Byte EncodingMask,
+    UInt32 Length,
+    String SecurityPolicyUri,
+    ByteString EncryptingCertificate,
+    DateTime SigningTime,
+    UInt16 PolicyHeaderLength,
+    ByteString SigningKey,
+    ByteString EncryptingKey,
+    ByteString InitializationVector,
+    ByteString Nonce,
+    Byte PolicyHeaderPadding optional,
+    UInt16 PolicyHeaderPaddingSize,
+    ByteString Secret,
+    Byte PayloadPadding optional,
+    UInt16 PayloadPaddingSize,
+    Byte Signature optional
+  }
+
+  type record RsaEncryptedSecret {
+    NodeId TypeId,
+    Byte EncodingMask,
+    UInt32 Length,
+    String SecurityPolicyUri,
+    ByteString EncryptingCertificate,
+    DateTime SigningTime,
+    UInt16 PolicyHeaderLength,
+    ByteString SigningKey,
+    ByteString EncryptingKey,
+    ByteString InitializationVector,
+    ByteString Nonce,
+    Byte PolicyHeaderPadding optional,
+    UInt16 PolicyHeaderPaddingSize,
+    ByteString Secret,
+    Byte PayloadPadding optional,
+    UInt16 PayloadPaddingSize,
+    Byte Signature optional
+  }
+
+  type record AnonymousIdentityToken {
+    String policyId
+  }
+
+  type record UserNameIdentityToken {
+    String policyId,
+    String userName,
+    ByteString password,
+    String encryptionAlgorithm
+  }
+
+  type record X509IdentityToken {
+    String policyId,
+    ByteString certificateData
+  }
+
+  type record IssuedIdentityToken {
+    String policyId,
+    ByteString tokenData,
+    String encryptionAlgorithm
+  }
+
+  type record UserTokenPolicy {
+    String policyId,
+    UserIdentityTokenType tokenType,
+    String issuedTokenType,
+    String issuerEndpointUrl,
+    String securityPolicyUri
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Structures for  Services                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record ViewDescription {
+    NodeId viewId,
+    UtcTime timestamp,
+    UInt32 viewVersion
+  }
+
+  type record TrustListDataType {
+    TrustListMasks specifiedLists,
+    ListOfByteString trustedCertificates,
+    ListOfByteString trustedCrls,
+    ListOfByteString issuerCertificates,
+    ListOfByteString issuerCrls
+  }
+
+  type record ServerOnNetwork {
+    UInt32 recordId,
+    String serverName,
+    String discoveryUrl,
+    ListOfString serverCapabilities
+  }
+
+  type record AddNodesItem {
+    ExpandedNodeId parentNodeId,
+    NodeId referenceTypeId,
+    QualifiedName browseName,
+    NodeClass nodeClass,
+    ExtensibleParameter nodeAttributes,
+    ExpandedNodeId typeDefinition
+  }
+
+  type record AddNodesResult {
+    StatusCode statusCode optional,
+    NodeId addedNodeId,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record AddReferencesItem {
+    NodeId sourceNodeId,
+    NodeId referenceTypeId,
+    Boolean isForward,
+    String targetServerUri,
+    ExpandedNodeId targetNodeId,
+    NodeClass targetNodeClass
+  }
+
+  type record DeleteNodesItem {
+    NodeId nodeId,
+    Boolean deleteTargetReferences
+  }
+
+  type record DeleteReferencesItem {
+    NodeId sourceNodeId,
+    NodeId referenceTypeId,
+    Boolean isForward,
+    ExpandedNodeId targetNodeId,
+    Boolean deleteBidirectional
+  }
+
+    type record BrowseDescription {
+    NodeId nodeId,
+    BrowseDirection browseDirection,
+    NodeId referenceTypeId,
+    Boolean includeSubtypes,
+    UInt32 nodeClassMask,
+    UInt32 resultMask
+  }
+
+  type record SignatureData {
+    String algorithm,
+    ByteString Signature
+  }
+
+  type record SignedSoftwareCertificate {
+    ByteString certificateData,
+    ByteString Signature
+  }
+
+  type record BrowsePath {
+    NodeId startingNode,
+    RelativePath relativePath
+  }
+
+  type record BrowsePathResult {
+    StatusCode statusCode optional,
+    ListOfBrowsePathTarget targets
+  }
+
+  type record BrowsePathTarget {
+    ExpandedNodeId targetId,
+    Index remainingPathIndex
+  }
+
+  type record NodeTypeDescription {
+    ExpandedNodeId typeDefinitionNode,
+    Boolean includeSubtypes,
+    ListOfQueryDataDescription dataToReturn
+  }
+
+  type record QueryDataDescription {
+    RelativePath relativePath,
+    IntegerId attributeId,
+    NumericRange indexRange
+  }
+
+  type record ParsingResult {
+    StatusCode statusCode optional,
+    ListOfStatusCode dataStatusCodes,
+    ListOfDiagnosticInfo dataDiagnosticInfos
+  }
+
+  type record ReadEventDetails {
+    Counter numValuesPerNode,
+    UtcTime startTime,
+    UtcTime endTime,
+    EventFilter Filter
+  }
+
+  type record ReadRawModifiedDetails {
+    Boolean isReadModified ,
+    UtcTime startTime,
+    UtcTime endTime,
+    Counter numValuesPerNode,
+    Boolean returnBounds
+  }
+
+  type record ReadProcessedDetails {
+    UtcTime startTime,
+    UtcTime endTime,
+    Duration ProcessingInterval,
+    ListOfNodeId aggregateType,
+    AggregateConfiguration aggregateConfiguration
+  }
+
+  type record ReadAtTimeDetails {
+    ListOfUtcTime reqTimes,
+    Boolean useSimpleBounds
+  }
+
+  type record HistoryReadValueId {
+    NodeId nodeId,
+    NumericRange indexRange,
+    QualifiedName dataEncoding,
+    ByteString continuationPoint
+  }
+
+  type record HistoryReadResult {
+    StatusCode statusCode optional,
+    ByteString continuationPoint,
+    ExtensibleParameter historyData
+  }
+
+  type record WriteValue {
+    NodeId nodeId,
+    IntegerId attributeId,
+    NumericRange indexRange,
+    DataValue datavalue
+  }
+
+  type record UpdateDataDetails {
+    NodeId nodeId,
+    PerformUpdateType performInsertReplace,
+    ListOfDataValue updateValues
+  }
+
+  type record UpdateStructureDataDetails {
+    NodeId nodeId,
+    PerformUpdateTypeExtended performInsertReplace,
+    ListOfDataValue updateValues
+  }
+
+  type record UpdateEventDetails {
+    NodeId nodeId,
+    PerformUpdateType performInsertReplace,
+    EventFilter filter,
+    ListOfDataValue updateValues
+  }
+
+  type record DeleteRawModifiedDetails {
+    NodeId nodeId,
+    Boolean isDeleteModified,
+    UtcTime startTime,
+    UtcTime endTime
+  }
+
+  type record DeleteAtTimeDetails {
+    NodeId nodeId,
+    ListOfUtcTime reqTimes
+  }
+
+  type record DeleteEventDetails {
+    NodeId nodeId,
+    ListOfByteString eventId
+  }
+
+  type record HistoryUpdateResult {
+    StatusCode statusCode optional,
+    ListOfStatusCode operationResults,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record CallMethodRequest {
+    NodeId objectId,
+    NodeId methodId,
+    ListOfVariant inputArguments
+  }
+
+  type record CallMethodResult {
+    StatusCode statusCode optional,
+    ListOfStatusCode inputArgumentResults,
+    ListOfDiagnosticInfo inputArgumentDiagnosticInfos,
+    ListOfVariant outputArguments
+  }
+
+  type record MonitoredItemCreateRequest {
+    ReadValueId itemToMonitor,
+    MonitoringMode monitoringMode,
+    MonitoringParameters requestedParameters
+  }
+
+  type record MonitoredItemCreateResult {
+    StatusCode statusCode optional,
+    IntegerId monitoredItemId,
+    Duration revisedSamplingInterval,
+    Counter revisedQueueSize,
+    ExtensibleParameter filterResult
+  }
+
+  type record MonitoredItemModifyRequest {
+    IntegerId monitoredItemId,
+    MonitoringParameters requestedParameters
+  }
+
+  type record MonitoredItemModifyResult {
+    StatusCode statusCode optional,
+    Duration revisedSamplingInterval,
+    Counter revisedQueueSize,
+    ExtensibleParameter filterResult
+  }
+
+  type record SubscriptionAcknowledgement {
+    IntegerId subscriptionId,
+    Counter sequenceNumber
+  }
+
+  type record TransferResult {
+    StatusCode statusCode optional,
+    ListOfCounter availableSequenceNumbers
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                         Headers                         //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+
+  type record MessageHeader {
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize
+  }
+
+  type union SecurityHeader {
+    AsymmetricSecurityHeader asymmetricSecurityHeader,
+    SymmetricSecurityHeader symmetricSecurityHeader
+  }
+
+  type record SequenceHeader {
+    UInt32 SequenceNumber,
+    UInt32 RequestId
+  }
+
+  type record AsymmetricSecurityHeader {
+    Int32 SecurityPolicyUriLength,
+    ListOfByte SecurityPolicyUri,
+    Int32 SenderCertificateLength,
+    ListOfByte SenderCertificate,
+    Int32 ReceiverCertificateThumbprintLength,
+    ListOfByte ReceiverCertificateThumbprint
+  }
+
+  type record SymmetricSecurityHeader {
+    UInt32 TokenId
+  }
+
+  type record MessageFooter {
+    integer EncodingMask,
+    Byte PaddingSize optional,
+    ListOfByte Padding optional,
+    Byte ExtraPaddingSize optional,
+    ListOfByte Signature optional
+  }
+
+  type record AdditionalHeader {
+    ExpandedNodeId typeId,
+    Byte Value
+  }
+
+  type record RequestHeader {
+    SessionAuthenticationToken authenticationToken,
+    UtcTime timestamp,
+    IntegerId requestHandle,
+    UInt32 returnDiagnostics,
+    String auditEntryId,
+    UInt32 timeoutHint,
+    AdditionalHeader additionalHeader
+  }
+
+  type record ResponseHeader {
+    UtcTime timestamp,
+    IntegerId requestHandle,
+    StatusCode serviceResult optional,
+    DiagnosticInfo serviceDiagnostics,
+    ListOfString stringTable,
+    AdditionalHeader additionalHeader
+  }
+
+  type record ServiceFault {
+    ResponseHeader responseHeader
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                     Basic Messages                      //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record HelloMessage {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 version,
+    UInt32 receiveBufferSize,
+    UInt32 sendBufferSize,
+    UInt32 maxMessageSize,
+    UInt32 maxChunkCount,
+    String endPointUrl
+  }
+
+  type record AckMessage {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 version,
+    UInt32 receiveBufferSize,
+    UInt32 sendBufferSize,
+    UInt32 maxMessageSize,
+    UInt32 maxChunkCount
+  }
+
+  type record ErrorMessage {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 errorCode,
+    String reason
+  }
+
+  type record ReverseHelloMessage {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    String serverUri,
+    String endPointUrl
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Discovery Service Sets                  //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record FindServiceRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    String endpointUrl,
+    ListOfLocaleId localeIds,
+    ListOfString serverUris
+  }
+
+  type record FindServiceResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfApplicationDescription servers
+  }
+
+  type record FindServersOnNetworkRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    Counter startingRecordId,
+    UInt32 maxRecordsToReturn,
+    ListOfString serverCapabilityFilter
+  }
+
+  type record FindServersOnNetworkResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    UtcTime lastCounterResetTime,
+    ListOfServerOnNetwork servers
+  }
+
+  type record GetEndpointsRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    String endpointUrl,
+    ListOfLocaleId localeIds,
+    ListOfString profileUris
+  }
+
+  type record GetEndpointsResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfEndpointDescription Endpoints
+  }
+
+  type record RegisterServerRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    RegisteredServer server
+  }
+
+  type record RegisterServerResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader
+  }
+
+  type record RegisterServer2Request {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    RegisteredServer server,
+    ListOfExtensibleParameter discoveryConfiguration
+  }
+
+  type record RegisterServer2Response {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfStatusCode configurationResults,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //               SecureChannel Service Sets                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record OpenSecureChannelRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    ListOfByte securePolicyUri,
+    ListOfByte senderCertificate,
+    ListOfByte receiverCertificateThumbprint,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    UInt32 clientProtocolVersion,
+    SecurityTokenRequestType requestType,
+    MessageSecurityMode securityMode,
+    ByteString clientNonce,
+    UInt32 requestedLifetime
+  }
+
+  type record OpenSecureChannelResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    ListOfByte securePolicyUri,
+    ListOfByte senderCertificate,
+    ListOfByte receiverCertificateThumbprint,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    UInt32 serverProtocolVersion,
+    ChannelSecurityToken securityToken,
+    ByteString serverNonce
+  }
+
+  type record CloseSecureChannelRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader
+  }
+
+  type record CloseSecureChannelResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                Session Service Sets                     //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record CreateSessionRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ApplicationDescription clientDescription,
+    String serverUri,
+    String endpointUrl,
+    String sessionName,
+    ByteString clientNonce,
+    ByteString clientCertificate,
+    Duration requestedSessionTimeout,
+    UInt32 maxResponseMessageSize
+  }
+
+  type record CreateSessionResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    NodeId sessionId,
+    SessionAuthenticationToken authenticationToken,
+    Duration revisedSessionTimeout,
+    ByteString serverNonce,
+    ByteString serverCertificate,
+    ListOfEndpointDescription serverEndpoints,
+    ListOfSignedSoftwareCertificate serverSoftwareCertificates,
+    SignatureData serverSignature,
+    UInt32 maxRequestMessageSize
+  }
+
+  type record ActivateSessionRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    SignatureData clientSignature,
+    ListOfSignedSoftwareCertificate clientSoftwareCertificates,
+    ListOfLocaleId localeIds,
+    ExtensibleParameter userIdentityToken,
+    SignatureData userTokenSignature
+  }
+
+  type record ActivateSessionResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ByteString serverNonce,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record CloseSessionRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    Boolean deleteSubscriptions
+  }
+
+  type record CloseSessionResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader
+  }
+
+  type record CancelRequestRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    IntegerId requestHandle
+  }
+
+  type record CancelRequestResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    UInt32 cancelCount
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //              NodeManagement Service Sets                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record AddNodesRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfAddNodesItem nodesToAdd
+  }
+
+  type record AddNodesResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfAddNodesResult results
+  }
+
+  type record AddReferencesRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfAddReferencesItem referencesToAdd
+  }
+
+  type record AddReferencesResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record DeleteNodesRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfDeleteNodesItem nodesToDelete
+  }
+
+  type record DeleteNodesResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record DeleteReferencesRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfDeleteReferencesItem referencesToDelete
+  }
+
+  type record DeleteReferencesResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Browse Service Sets                     //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record BrowseRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ViewDescription view,
+    Counter requestedMaxReferencesPerNode,
+    ListOfBrowseDescription nodesToBrowse
+  }
+
+  type record BrowseResponse {
+    ResponseHeader responseHeader,
+    ListOfBrowseResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record BrowseNextRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    Boolean releaseContinuationPoints,
+    ListOfContinuationPoint continuationPoints
+  }
+
+  type record BrowseNextResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfBrowseResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record TranslateBrowsePathsToNodeIdsRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfBrowsePath browsePaths
+  }
+
+  type record TranslateBrowsePathsToNodeIdsResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfBrowsePathResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record RegisterNodesRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfNodeId nodesToRegister
+  }
+
+  type record RegisterNodesResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfNodeId registeredNodeIds
+  }
+
+  type record UnregisterNodesRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfNodeId nodesToUnregister
+  }
+
+  type record UnregisterNodesResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 Query Service Set                       //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record QueryFirstRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfNodeTypeDescription nodeTypes,
+    ContentFilter filter,
+    Counter maxDataSetsToReturn,
+    Counter maxReferencesToReturn
+  }
+
+  type record QueryFirstResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfQueryDataSet queryDataSets,
+    ContinuationPoint continuationPoint,
+    ListOfParsingResult parsingResults,
+    ListOfDiagnosticInfo diagnosticInfos,
+    ContentFilterResult filterResult
+  }
+
+  type record QueryNextRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    Boolean releaseContinuationPoint,
+    ContinuationPoint continuationPoint
+  }
+
+  type record QueryNextResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfQueryDataSet queryDataSets,
+    ContinuationPoint revisedContinuationPoint
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                Attribute Service Set                    //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record ReadRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    Duration maxAge,
+    TimestampsToReturn timestampsToReturn,
+    ListOfReadValueId nodesToRead
+  }
+
+  type record ReadResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfDataValue results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record HistoryReadRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ExtensibleParameter historyReadDetails,
+    TimestampsToReturn timestampsToReturn,
+    Boolean releaseContinuationPoints,
+    ListOfHistoryReadValueId nodesToRead
+  }
+
+  type record HistoryReadResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfHistoryReadResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record WriteRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfWriteValue nodesToWrite
+  }
+
+  type record WriteResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record HistoryUpdateRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfExtensibleParameter historyUpdateDetails
+  }
+
+  type record HistoryUpdateResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfHistoryUpdateResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                   Method Service Set                    //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record CallRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfCallMethodRequest methodsToCall
+  }
+
+  type record CallResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfCallMethodResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                MonitoredItem Service Set                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record CreateMonitoredItemsRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    TimestampsToReturn timestampsToReturn,
+    ListOfMonitoredItemCreateRequest itemsToCreate
+  }
+
+  type record CreateMonitoredItemsResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfMonitoredItemCreateResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record ModifyMonitoredItemsRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    TimestampsToReturn timestampsToReturn,
+    ListOfMonitoredItemModifyRequest itemsToModify
+  }
+
+  type record ModifyMonitoredItemsResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfMonitoredItemModifyResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record SetMonitoringModeRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    MonitoringMode monitoringMode,
+    ListOfIntegerId monitoredItemIds
+  }
+
+  type record SetMonitoringModeResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record SetTriggeringRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    IntegerId triggeringItemId,
+    ListOfIntegerId linksToAdd,
+    IntegerId linksToRemove
+  }
+
+  type record SetTriggeringResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfStatusCode addResults,
+    ListOfDiagnosticInfo addDiagnosticInfos,
+    ListOfStatusCode removeResults,
+    ListOfDiagnosticInfo removeDiagnosticInfos
+  }
+
+  type record DeleteMonitoredItemsRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    ListOfIntegerId monitoredItemIds
+  }
+
+  type record DeleteMonitoredItemsResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                Subscription  Service Set                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type record CreateSubscriptionRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    Duration requestedPublishingInterval,
+    Counter requestedLifetimeCount,
+    Counter requestedMaxKeepAliveCount,
+    Counter maxNotificationsPerPublish,
+    Boolean publishingEnabled,
+    Byte priorityInt32
+  }
+
+  type record CreateSubscriptionResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    IntegerId subscriptionId,
+    Duration revisedPublishingInterval,
+    Counter revisedLifetimeCount,
+    Counter revisedMaxKeepAliveCount
+  }
+
+  type record ModifySubscriptionRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    Duration requestedPublishingInterval,
+    Counter requestedLifetimeCount,
+    Counter requestedMaxKeepAliveCount,
+    Counter maxNotificationsPerPublish,
+    Byte priority
+  }
+
+  type record ModifySubscriptionResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    Duration revisedPublishingInterval,
+    Counter revisedLifetimeCount,
+    Counter revisedMaxKeepAliveCount
+  }
+
+  type record SetPublishingModeRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    Boolean publishingEnabled,
+    ListOfIntegerId subscriptionIds
+  }
+
+  type record SetPublishingModeResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record PublishRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfSubscriptionAcknowledgement subscriptionAcknowledgements
+  }
+
+  type record PublishResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    IntegerId subscriptionId,
+    ListOfCounter availableSequenceNumbers,
+    Boolean moreNotifications,
+    NotificationMessage notificationMessage,
+    record of StatusCode results,
+    record of DiagnosticInfo diagnosticInfos
+  }
+
+  type record RepublishRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    IntegerId subscriptionId,
+    Counter retransmitSequenceNumber
+  }
+
+  type record RepublishResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    NotificationMessage notificationMessage
+  }
+
+  type record TransferSubscriptionsRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfIntegerId subscriptionIds,
+    Boolean sendInitialValues
+  }
+
+  type record TransferSubscriptionsResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfTransferResult results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  type record DeleteSubscriptionsRequest {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    RequestHeader requestHeader,
+    ListOfIntegerId subscriptionIds
+  }
+
+  type record DeleteSubscriptionsResponse {
+    //Message header
+    UInt24 messageType,
+    Byte chunkType,
+    UInt32 messageSize,
+
+    //Message Body
+    UInt32 securityChannelId,
+    UInt32 securityTokenId,
+    SequenceHeader sequenceHeader,
+
+    //Service Header
+    Byte encodingByte,
+    Byte namespaceIndex,
+    UInt16 nodeValue,
+
+    //Service Body
+    ResponseHeader responseHeader,
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                Session-less Service                     //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  /*type record SessionlessInvokeRequest {
+    VersionTime urisVersion,
+    ListOfString namespaceUris,
+    ListOfString serverUris,
+    ListOfLocaleId localeIds,
+    UInt32 serviceId,
+    SessionlessServices body
+  }
+
+  type record SessionlessInvokeResponse {
+    ListOfString namespaceUris,
+    ListOfString serverUris,
+    UInt32 serviceId,
+    SessionlessServices body
+  }*/
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                    Encoded Types                        //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  type union MessageTypes {
+    //BasicMessages
+    HelloMessage HelloMessage,
+    AckMessage AckMessage,
+    ErrorMessage ErrorMessage,
+    ReverseHelloMessage ReverseHelloMessage,
+
+    //DiscoveryServices
+    FindServiceRequest FindServiceRequest,
+    FindServiceResponse FindServiceResponse,
+    FindServersOnNetworkRequest FindServersOnNetworkRequest,
+    FindServersOnNetworkResponse FindServersOnNetworkResponse,
+    GetEndpointsRequest GetEndpointsRequest,
+    GetEndpointsResponse GetEndpointsResponse,
+    RegisterServerRequest RegisterServerRequest,
+    RegisterServerResponse RegisterServerResponse,
+    RegisterServer2Request RegisterServer2Request,
+    RegisterServer2Response RegisterServer2Response,
+
+    //Secure Channel services
+    OpenSecureChannelRequest OpenSecureChannelRequest,
+    OpenSecureChannelResponse OpenSecureChannelResponse,
+    CloseSecureChannelRequest CloseSecureChannelRequest,
+    CloseSecureChannelResponse CloseSecureChannelResponse,
+
+    //Session Services
+    CreateSessionRequest CreateSessionRequest,
+    CreateSessionResponse CreateSessionResponse,
+    ActivateSessionRequest ActivateSessionRequest,
+    ActivateSessionResponse ActivateSessionResponse,
+    CloseSessionRequest CloseSessionRequest,
+    CloseSessionResponse CloseSessionResponse,
+    CancelRequestRequest CancelRequestRequest,
+    CancelRequestResponse CancelRequestResponse,
+
+    //Node Management Services
+    AddNodesRequest AddNodesRequest,
+    AddNodesResponse AddNodesResponse,
+    AddReferencesRequest AddReferencesRequest,
+    AddReferencesResponse AddReferencesResponse,
+    DeleteNodesRequest DeleteNodesRequest,
+    DeleteNodesResponse DeleteNodesResponse,
+    DeleteReferencesRequest DeleteReferencesRequest,
+    DeleteReferencesResponse DeleteReferencesResponse,
+
+    //View Services
+    BrowseRequest BrowseRequest,
+    BrowseResponse BrowseResponse,
+    BrowseNextRequest BrowseNextRequest,
+    BrowseNextResponse BrowseNextResponse,
+    TranslateBrowsePathsToNodeIdsRequest TranslateBrowsePathsToNodeIdsRequest,
+    TranslateBrowsePathsToNodeIdsResponse TranslateBrowsePathsToNodeIdsResponse,
+    RegisterNodesRequest RegisterNodesRequest,
+    RegisterNodesResponse RegisterNodesResponse,
+    UnregisterNodesRequest UnregisterNodesRequest,
+    UnregisterNodesResponse UnregisterNodesResponse,
+
+    //Query Services
+    QueryFirstRequest QueryFirstRequest,
+    QueryFirstResponse QueryFirstResponse,
+    QueryNextRequest QueryNextRequest,
+    QueryNextResponse QueryNextResponse,
+
+    //Attribute Services
+    ReadRequest ReadRequest,
+    ReadResponse ReadResponse,
+    HistoryReadRequest HistoryReadRequest,
+    HistoryReadResponse HistoryReadResponse,
+    WriteRequest WriteRequest,
+    WriteResponse WriteResponse,
+
+    //Method Services
+    HistoryUpdateRequest HistoryUpdateRequest,
+    HistoryUpdateResponse HistoryUpdateResponse,
+    CallRequest CallRequest,
+    CallResponse CallResponse,
+
+    //Monitored Item Services
+    CreateMonitoredItemsRequest CreateMonitoredItemsRequest,
+    CreateMonitoredItemsResponse CreateMonitoredItemsResponse,
+    ModifyMonitoredItemsRequest ModifyMonitoredItemsRequest,
+    ModifyMonitoredItemsResponse ModifyMonitoredItemsResponse,
+    SetMonitoringModeRequest SetMonitoringModeRequest,
+    SetMonitoringModeResponse SetMonitoringModeResponse,
+    SetTriggeringRequest SetTriggeringRequest,
+    SetTriggeringResponse SetTriggeringResponse,
+    DeleteMonitoredItemsRequest DeleteMonitoredItemsRequest,
+    DeleteMonitoredItemsResponse DeleteMonitoredItemsResponse,
+
+    //Subscription Services
+    CreateSubscriptionRequest CreateSubscriptionRequest,
+    CreateSubscriptionResponse CreateSubscriptionResponse,
+    ModifySubscriptionRequest ModifySubscriptionRequest,
+    ModifySubscriptionResponse ModifySubscriptionResponse,
+    SetPublishingModeRequest SetPublishingModeRequest,
+    SetPublishingModeResponse SetPublishingModeResponse,
+    PublishRequest PublishRequest,
+    PublishResponse PublishResponse,
+    RepublishRequest RepublishRequest,
+    RepublishResponse RepublishResponse,
+    TransferSubscriptionsRequest TransferSubscriptionsRequest,
+    TransferSubscriptionsResponse TransferSubscriptionsResponse,
+    DeleteSubscriptionsRequest DeleteSubscriptionsRequest,
+    DeleteSubscriptionsResponse DeleteSubscriptionsResponse,
+
+    //Sessionless Invoke Services
+    //SessionlessInvokeRequest SessionlessInvokeRequest,
+    //SessionlessInvokeResponse  SessionlessInvokeResponse,
+
+    ReadRequest readRequest,
+    ReadResponse readResponse,
+    WriteRequest writeRequest,
+    WriteResponse writeResponse,
+    CallRequest callRequest,
+    CallResponse callResponse
+  } with {
+    variant "JSON: as value"
+  }
+
+} with { encode "JSON" }
\ No newline at end of file
diff --git a/src/OpcUa_Types_JSON_Reversible.ttcn b/src/OpcUa_Types_JSON_Reversible.ttcn
index 3d2cc1c..79b5cc2 100644
--- a/src/OpcUa_Types_JSON_Reversible.ttcn
+++ b/src/OpcUa_Types_JSON_Reversible.ttcn
@@ -22,7 +22,6 @@
   //                                                         //
   /////////////////////////////////////////////////////////////
 
-  //TODO: Add ecoders and decoders
   external function enc_MessageTypes (in MessageTypes msg) return octetstring
     with { extension "prototype(convert) encode(JSON)" }
 
@@ -402,7 +401,7 @@
   //An XML element, as an XML fragment serialized as UTF-8 string
   type charstring XmlElement;
 
-  //
+  //A StatusCode of Good (0) is treated like a NULL and not encoded. If it is an element of an JSON array it is encoded as the JSON literal ‘null’
   type integer StatusCode;
 
   type Int32 DataType;
@@ -458,7 +457,7 @@
     Int32 Locale,
     Int32 LocalizedText,
     String AdditionalInfo,
-    StatusCode InnerStatusCode,
+    StatusCode InnerStatusCode optional,
     DiagnosticInfo InnerDiagnosticInfo optional
   }
 
@@ -771,7 +770,7 @@
   }
 
   type record BrowseResult {
-    StatusCode statusCode,
+    StatusCode statusCode optional,
     ContinuationPoint continuationPoint,
     ListOfReferenceDescription References
   }
@@ -791,7 +790,7 @@
   }
 
   type record ContentFilterElementResult {
-    StatusCode statusCode,
+    StatusCode statusCode optional,
     ListOfStatusCode operandStatusCodes,
     ListOfDiagnosticInfo operandDiagnosticInfos
   }
@@ -1001,7 +1000,7 @@
   }
 
   type record StatusChangeNotification {
-    StatusCode status,
+    StatusCode status optional,
     DiagnosticInfo diagnosticInfo
   }
 
@@ -1191,7 +1190,7 @@
   }
 
   type record AddNodesResult {
-    StatusCode statusCode,
+    StatusCode statusCode optional,
     NodeId addedNodeId,
     ListOfDiagnosticInfo diagnosticInfos
   }
@@ -1243,7 +1242,7 @@
   }
 
   type record BrowsePathResult {
-    StatusCode statusCode,
+    StatusCode statusCode optional,
     ListOfBrowsePathTarget targets
   }
 
@@ -1265,7 +1264,7 @@
   }
 
   type record ParsingResult {
-    StatusCode statusCode,
+    StatusCode statusCode optional,
     ListOfStatusCode dataStatusCodes,
     ListOfDiagnosticInfo dataDiagnosticInfos
   }
@@ -1306,7 +1305,7 @@
   }
 
   type record HistoryReadResult {
-    StatusCode statusCode,
+    StatusCode statusCode optional,
     ByteString continuationPoint,
     ExtensibleParameter historyData
   }
@@ -1355,7 +1354,7 @@
   }
 
   type record HistoryUpdateResult {
-    StatusCode statusCode,
+    StatusCode statusCode optional,
     ListOfStatusCode operationResults,
     ListOfDiagnosticInfo diagnosticInfos
   }
@@ -1367,7 +1366,7 @@
   }
 
   type record CallMethodResult {
-    StatusCode statusCode,
+    StatusCode statusCode optional,
     ListOfStatusCode inputArgumentResults,
     ListOfDiagnosticInfo inputArgumentDiagnosticInfos,
     ListOfVariant outputArguments
@@ -1380,7 +1379,7 @@
   }
 
   type record MonitoredItemCreateResult {
-    StatusCode statusCode,
+    StatusCode statusCode optional,
     IntegerId monitoredItemId,
     Duration revisedSamplingInterval,
     Counter revisedQueueSize,
@@ -1393,7 +1392,7 @@
   }
 
   type record MonitoredItemModifyResult {
-    StatusCode statusCode,
+    StatusCode statusCode optional,
     Duration revisedSamplingInterval,
     Counter revisedQueueSize,
     ExtensibleParameter filterResult
@@ -1405,7 +1404,7 @@
   }
 
   type record TransferResult {
-    StatusCode statusCode,
+    StatusCode statusCode optional,
     ListOfCounter availableSequenceNumbers
   }
 
@@ -1471,7 +1470,7 @@
   type record ResponseHeader {
     UtcTime timestamp,
     IntegerId requestHandle,
-    StatusCode serviceResult,
+    StatusCode serviceResult optional,
     DiagnosticInfo serviceDiagnostics,
     ListOfString stringTable,
     AdditionalHeader additionalHeader
@@ -3189,8 +3188,8 @@
     ListOfCounter availableSequenceNumbers,
     Boolean moreNotifications,
     NotificationMessage notificationMessage,
-    record of StatusCode results,
-    record of DiagnosticInfo diagnosticInfos
+    ListOfStatusCode results,
+    ListOfDiagnosticInfo diagnosticInfos
   }
 
   type record RepublishRequest {
diff --git a/test/OPC_UA_v1.04_test.tpd b/test/OPC_UA_v1.04_test.tpd
old mode 100644
new mode 100755
index 8f4bb3c..069f953
--- a/test/OPC_UA_v1.04_test.tpd
+++ b/test/OPC_UA_v1.04_test.tpd
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<TITAN_Project_File_Information version="1.0">

-  <ProjectName>OPC_UA_v1.04</ProjectName>

-  <ReferencedProjects>

-    <ReferencedProject name="OPC_UA_v1.04" projectLocationURI="../OPC_UA_v1.04.tpd"/>

-    <ReferencedProject name="ProtocolModules_Common" projectLocationURI="../../COMMON/ProtocolModules_Common.tpd"/>

-    <ReferencedProject name="IPL4asp_CNL113531" projectLocationURI="../../../TestPorts/IPL4asp_CNL113531/IPL4asp_CNL113531.tpd"/>

-  </ReferencedProjects>

-  <Files>

-    <FileResource projectRelativePath="OpcUa.cfg" relativeURI="OpcUa.cfg"/>

-    <FileResource projectRelativePath="OpcUa_Encoded_Messages.ttcn" relativeURI="OpcUa_Encoded_Messages.ttcn"/>

-    <FileResource projectRelativePath="OpcUa_Functions.ttcn" relativeURI="OpcUa_Functions.ttcn"/>

-    <FileResource projectRelativePath="OpcUa_Message_Templates.ttcn" relativeURI="OpcUa_Message_Templates.ttcn"/>

-    <FileResource projectRelativePath="OpcUa_Test.ttcn" relativeURI="OpcUa_Test.ttcn"/>

-    <FileResource projectRelativePath="server.js" relativeURI="server.js"/>

-  </Files>

-  <ActiveConfiguration>Default</ActiveConfiguration>

-  <Configurations>

-    <Configuration name="Default">

-      <ProjectProperties>

-        <MakefileSettings>

-          <generateInternalMakefile>true</generateInternalMakefile>

-          <GNUMake>true</GNUMake>

-          <incrementalDependencyRefresh>true</incrementalDependencyRefresh>

-          <targetExecutable>bin/OPC</targetExecutable>

-        </MakefileSettings>

-        <LocalBuildSettings>

-          <workingDirectory>bin</workingDirectory>

-        </LocalBuildSettings>

-      </ProjectProperties>

-    </Configuration>

-  </Configurations>

-</TITAN_Project_File_Information>

+<?xml version="1.0" encoding="UTF-8"?>
+<TITAN_Project_File_Information version="1.0">
+  <ProjectName>OPC_UA_v1.04</ProjectName>
+  <ReferencedProjects>
+    <ReferencedProject name="OPC_UA_v1.04" projectLocationURI="../OPC_UA_v1.04.tpd"/>
+    <ReferencedProject name="ProtocolModules_Common" projectLocationURI="../../COMMON/ProtocolModules_Common.tpd"/>
+    <ReferencedProject name="IPL4asp_CNL113531" projectLocationURI="../../../TestPorts/IPL4asp_CNL113531/IPL4asp_CNL113531.tpd"/>
+  </ReferencedProjects>
+  <Files>
+    <FileResource projectRelativePath="OpcUa.cfg" relativeURI="OpcUa.cfg"/>
+    <FileResource projectRelativePath="OpcUa_Encoded_Messages.ttcn" relativeURI="OpcUa_Encoded_Messages.ttcn"/>
+    <FileResource projectRelativePath="OpcUa_Functions.ttcn" relativeURI="OpcUa_Functions.ttcn"/>
+    <FileResource projectRelativePath="OpcUa_Message_Templates.ttcn" relativeURI="OpcUa_Message_Templates.ttcn"/>
+    <FileResource projectRelativePath="OpcUa_Test.ttcn" relativeURI="OpcUa_Test.ttcn"/>
+    <FileResource projectRelativePath="server.js" relativeURI="server.js"/>
+  </Files>
+  <ActiveConfiguration>Default</ActiveConfiguration>
+  <Configurations>
+    <Configuration name="Default">
+      <ProjectProperties>
+        <MakefileSettings>
+          <generateInternalMakefile>true</generateInternalMakefile>
+          <GNUMake>true</GNUMake>
+          <incrementalDependencyRefresh>true</incrementalDependencyRefresh>
+          <targetExecutable>bin/OPC</targetExecutable>
+        </MakefileSettings>
+        <LocalBuildSettings>
+          <workingDirectory>bin</workingDirectory>
+        </LocalBuildSettings>
+      </ProjectProperties>
+    </Configuration>
+  </Configurations>
+</TITAN_Project_File_Information>
diff --git a/test/OpcUa.cfg b/test/OpcUa.cfg
old mode 100644
new mode 100755
index 3438c0b..a0accf9
--- a/test/OpcUa.cfg
+++ b/test/OpcUa.cfg
@@ -36,4 +36,5 @@
 

 [EXECUTE]

 OpcUa_Test_Binary.control

-OpcUa_Test_JSON.control
\ No newline at end of file
+OpcUa_Test_JSON_Reversible.control

+OpcUa_Test_JSON_Non_Reversible.control
\ No newline at end of file
diff --git a/test/OpcUa_Encoded_Messages.ttcn b/test/OpcUa_Encoded_Messages.ttcn
index 406aea6..2fe59e7 100644
--- a/test/OpcUa_Encoded_Messages.ttcn
+++ b/test/OpcUa_Encoded_Messages.ttcn
@@ -1,76 +1,76 @@
-/////////////////////////////////////////////////////////////////////////////////////

-// Copyright (c) 2017-2018  Ericsson AB

-// All rights reserved. This program and the accompanying materials

-// are made available under the terms of the Eclipse Public License v1.0

-// which accompanies this distribution, and is available at

-// http://www.eclipse.org/legal/epl-v10.html

-/////////////////////////////////////////////////////////////////////////////////////

-// Contributors:

-// Akos Makovics

-//

-//  File:         UpcUa_Encoded_Messages.ttcn

-//  Rev:          <RnXnn>

-//  Prodnr:       CNL113861

-/////////////////////////////////////////////////////////////////////////////////////

-

-module OpcUa_Encoded_Messages {

-

-  const octetstring encodedBinaryHello := '48454c46530000000000000000000a0000000a000000000000000000330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c65536572766572'O;

-  const octetstring encodedBinaryAck := '41434b461c00000000000000000008000000080000000001ffff0000'O;

-  const octetstring encodedBinaryError := '455252461000000000000280ffffffff'O;

-

-  const octetstring encodedBinaryOpenSecReq := '4f504e4684000000000000002f000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234e6f6e65ffffffffffffffff01000000010000000100be010000d08f18e2a674d3010100000000000000ffffffff00000000000000000000000000000001000000ffffffffc0270900'O;

-  const octetstring encodedBinaryOpenSecResp := '4f504e4687000000080000002f000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234e6f6e65ffffffffffffffff01000000010000000100c101b0ef92d52d68d30101000000000000000000000000000000000000000800000001000000b0ef92d52d68d301c0270900ffffffff'O;

-

-  const octetstring encodedBinaryCloseSecReq := '434c4f4639000000010000000100000015000000150000000100c401000010278f86e561d30115000000000000000000000000000000000000'O;

-  const octetstring encodedBinaryCloseSecResp := ''O;

-

-  const octetstring encodedBinaryGetEndointsReq := '4d53474645000000010000000100000002000000020000000100ac01000080ff6c83e561d3010200000000000000ffffffff00000000000000000000000000000000000000'O;

-  const octetstring encodedBinaryGetEndointsResp := '4d534746de1e0000010000000100000002000000020000000100af01d0c26d83e561d3010200000000000000000000000000000005000000330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba010000002f000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234e6f6e650300000011000000757365726e616d655f626173696332353601000000ffffffffffffffff33000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696332353611000000757365726e616d655f626173696331323801000000ffffffffffffffff38000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234261736963313238527361313509000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0200000038000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696331323852736131350200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0200000033000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c6963792342617369633235360200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0300000038000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696331323852736131350200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0300000033000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c6963792342617369633235360200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903'O;

-

-  const octetstring encodedBinaryCreateSessionReq := '4d534746e5050000020000000100000003000000030000000100cd01000080412932b378d301030000000000000000000000000000000000002800000075726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d536572766572100000004e6f64654f504355412d436c69656e7402100000004e6f64654f504355412d436c69656e74010000000000000000000000000000001c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665720800000053657373696f6e31200000006ad255a998622c70751a698132155b637162d8d0ef28be58a524c3eb0a6059e1b0040000308204ac30820394a003020102020900c1e87463123e0657300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533325a170d3332313031353039323533325a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100a2f976c17a3b097b145184e6de1f51995fe6eba577952fd8645755eb9bc92e3199c087c6d0ef03ad7fd785750615789ab10edcd78f11680f69bb393b91de4f3e70de7428537960b3074d43465bfd6ef3025168e4e1907f94f89cd83ac5033332c7a11aacedc4e104067793b57ebe24c8e9c7c141bf245a4c7f1479ce9252bf450531d448b64b29836ec2b5eb1c60cd8496b3ab5aaa42be5a8d75b4cbafe82432dd4073400d0054c3619a34059c725f1ec045b34a9443b5d83381c378d301720e948bd3e75b801a3f2463c194fbfb4ce75f5444d4eb6577440feec7e8ef03e47c2985c16cb4da310d8c0d2bbb6c3c06a3fbca35b4b18d722d27ecc4f83d218ed70203010001a382017730820173301d0603551d0e04160414117cbf1ee99a7f73ccfea8417052a792bf2a55193081890603551d23048181307f8014117cbf1ee99a7f73ccfea8417052a792bf2a5519a15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900c1e87463123e0657300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100168990e180793fe78ec638c08d6fe2d9d7178806f620c9d853bf6b7465ece3ae285910c46ace3a2c39bee7cade3703a805673621f5f79e3e0e70fcd0c76458d5a566734ab82b1909bda389a14db52e907ca5a17610298bb5d19495e0ab909164e22c18421c33e3141953f2675ec48fc033f3ba5471a85234f477ddb797b470fe8455f3969584e913be62b2a65a0488bb2b6b0b607c1c007209e1a1ea171243d2433e41483716522193e2aec6b3b1d54d36920f0b6da9748f46b7d52472728303a4dd23e2dd140b0ff8f1973de50c9750452138ccf82a4eb93d92fec4bc3381e285a7c13a9f94def9608f7ab21ec928c5f0653a4757e58a6018bfc223177b881400000000004ced4000350c00'O;

-  const octetstring encodedBinaryCreateSessionResp := '4d534746f8230000010000000100000003000000030000000100d001301e7183e561d30103000000000000000000000000000000040100cbdb813cc60c0d8170bf3a500c4ccee905000010000000d5deaf3a32bf386ea128bece2e62a24600000000004ced40200000003db07d198a2ce0ac25f80d25ea4e5039eee69de061e772d2b245c8935e9524f7b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba05000000330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba010000002f000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234e6f6e650300000011000000757365726e616d655f626173696332353601000000ffffffffffffffff33000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696332353611000000757365726e616d655f626173696331323801000000ffffffffffffffff38000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234261736963313238527361313509000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0200000038000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696331323852736131350200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0200000033000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c6963792342617369633235360200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0300000038000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696331323852736131350200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0300000033000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c6963792342617369633235360200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e6172790300000000ffffffffffffffff00000004'O;

-

-  const octetstring encodedBinaryActivateSessionReq := '4d5347467c000000020000000100000004000000040000000100d30105000010000000df4bafc3504bcefa06261658743e65a130ef2a32b378d30104000000000000000000000000000000000000ffffffffffffffff000000000000000001004101010d00000009000000616e6f6e796d6f7573ffffffffffffffff'O;

-  const octetstring encodedBinaryActivateSessionResp := '4d53474660000000010000000100000004000000040000000100d60130a68483e561d30104000000000000000000000000000000200000006bbe056e71ce657d6fb6663e600ae2cf61af5383e5b390dbe85ba33aae4a10ab0000000000000000'O;

-

-  const octetstring encodedBinaryBrowseReq := '4d534746750000000100000001000000050000000500000001000f0205000010000000d5deaf3a32bf386ea128bece2e62a24650f48483e561d3010500000000000000000000000000000000000000000000000000000000000000001027000001000000005402000000000001000000003f000000'O;

-  const octetstring encodedBinaryBrowseResp := '4d5347460a0300005829060001000000f6000000f800000001001202d2bfaefad469d30136430f000000000000000000000000000100000000000000ffffffff11000000002d010001000007000000426f6f6c65616e0207000000426f6f6c65616e400000000000002d01000c000006000000537472696e670206000000537472696e67400000000000002d01000d0000080000004461746554696d6502080000004461746554696d65400000000000002d01000e00000400000047756964020400000047756964400000000000002d01000f00000a00000042797465537472696e67020a00000042797465537472696e67400000000000002d01001000000a000000586d6c456c656d656e74020a000000586d6c456c656d656e74400000000000002d0100110000060000004e6f6465496402060000004e6f64654964400000000000002d01001200000e000000457870616e6465644e6f64654964020e000000457870616e6465644e6f64654964400000000000002d01001300000a000000537461747573436f6465020a000000537461747573436f6465400000000000002d01001400000d0000005175616c69666965644e616d65020d0000005175616c69666965644e616d65400000000000002d01001500000d0000004c6f63616c697a656454657874020d0000004c6f63616c697a656454657874400000000000002d0100160000090000005374727563747572650209000000537472756374757265400000000000002d0100170000090000004461746156616c756502090000004461746156616c7565400000000000002d01001900000e000000446961676e6f73746963496e666f020e000000446961676e6f73746963496e666f400000000000002d01001a0000060000004e756d62657202060000004e756d626572400000000000002d01001d00000b000000456e756d65726174696f6e020b000000456e756d65726174696f6e400000000000002d010102bf2602000f00000056617269616e744461746154797065020f00000056617269616e74446174615479706540000000000000000000'O;

-

-  const octetstring encodedBinaryReadReq := '4d5347467e000000010000000100000007000000070000000100770205000010000000d5deaf3a32bf386ea128bece2e62a246608c8783e561d30107000000000000000000000000000000000000000000000000000002000000010000000301000b000000667265655f6d656d6f72790d000000ffffffff0000ffffffff'O;

-  const octetstring encodedBinaryReadResp:= '4d534746fa0000005829060001000000f5000000f700000001007a02d2bfaefad469d30137430f000000000000000000000000000800000009110018d2bfaefad469d301090640000000d2bfaefad469d301091400000c000000426173654461746154797065d2bfaefad469d3010915020c000000426173654461746154797065d2bfaefad469d301091503000000003300000044657363726962657320612076616c756520746861742063616e206861766520616e792076616c69642044617461547970652ed2bfaefad469d301090700000000d2bfaefad469d301090700000000d2bfaefad469d301090101d2bfaefad469d30100000000'O;

-

-  const octetstring encodedBinaryWriteReq := '4d53474680000000b129060001000000120100001201000001007702050000200000009d404fe935df0e7bba3a0bec377b0417f986c7c344e82a93c8416e5d71417abb7728de11d969d3010d00000000000000ffffffff10270000000000000000000000000003000000010000000100d3080d000000ffffffff0000ffffffff'O;

-  const octetstring encodedBinaryWriteResp := '4d53474642000000b129060001000000140100001201000001007a02ec8d1112d969d3010d0000000000000000000000000000000100000001060000000000000000'O;

-

-  const octetstring encodedBinaryCreateSubscReq := '4d53474664000000010000000100000008000000080000000100130305000010000000d5deaf3a32bf386ea128bece2e62a246f0eb8883e561d301080000000000000000000000000000000000000000000000408f400a000000020000000a000000010a'O;

-  const octetstring encodedBinaryCreateSubscResp := '4d53474648000000010000000100000008000000080000000100160340029183e561d30108000000000000000000000000000000f90c07000000000000408f400a00000002000000'O;

-

-  const octetstring encodedBinaryCreateMonitoredItemReq := '4d53474692000000010000000100000009000000090000000100ef0205000010000000d5deaf3a32bf386ea128bece2e62a24670779183e561d30109000000000000000000000000000000000000f90c070002000000010000000301000b000000667265655f6d656d6f72790d000000ffffffff0000ffffffff020000000100000000000000000059400000000a00000001'O;

-  const octetstring encodedBinaryCreateMonitoredItemResp := '4d53474653000000010000000100000009000000090000000100f202e0889283e561d301090000000000000000000000000000000100000000000000010000000000000000408f400a00000000000000000000'O;

-

-  const octetstring encodedBinarySetMonitoringModeReq := '4d5347466e0000000321060001000000d9000000a700000001000103050000200000009bde93aaa343bd63632e3d509ed586eb5f904133020df86dd2fdd34b4521c61fa7f6fc16ef68d301e6420f0000000000ffffffff10270000000000756a00000100000001000000783f0200'O;

-  const octetstring encodedBinarySetMonitoringModeResp := '4d534746400000000321060001000000a4000000a700000001000403e9281a17ef68d301e6420f00000000000000000000000000010000000000000000000000'O;

-

-  const octetstring encodedBinaryModifyMonitoredItemReq := '4d534746a1010000b12906000100000018020000180200000100fb02050000200000009d404fe935df0e7bba3a0bec377b0417f986c7c344e82a93c8416e5d71417abb02422221da69d301a8010000ff030000ffffffff000000000000009c6b000002000000010000000f5802000400000000000000003091400100d7020119010000090000000100f907010000000000070000004576656e7449640d000000ffffffff0100f907010000000000090000004576656e74547970650d000000ffffffff0100f9070100000000000a000000536f757263654e6f64650d000000ffffffff0100f9070100000000000a000000536f757263654e616d650d000000ffffffff0100f9070100000000000400000054696d650d000000ffffffff0100f9070100000000000b0000005265636569766554696d650d000000ffffffff0100f907010000000000090000004c6f63616c54696d650d000000ffffffff0100f907010000000000070000004d6573736167650d000000ffffffff0100f9070100000000000800000053657665726974790d000000ffffffff000000000000000000'O;

-  const octetstring encodedBinaryModifyMonitoredItemResp := '4d5347464f0000000321060001000000ab000000ae0000000100fe02ed2d201def68d301ed420f00000000000000000000000000010000000000458000000000000000000000000000000000000000'O;

-

-  const octetstring encodedBinaryPublishReq := '4d53474662000000b610060001000000630100003101000001003a030500002000000070746ffff126e654759e4c6cd4e31668ac7af98e50f29fa554171e3ec5a7b4623d8948378b67d30170430f0000000000ffffffff60ea0000000000ffffffff'O;

-  const octetstring encodedBinaryPublishResp := '4d5347465500000058290600010000003b0000003900000001003d0300919eebd369d30178420f00000000000000000000000000846b000000000000000100000000919eebd369d301000000000000000000000000'O;

-

-  const octetstring encodedBinaryDeleteSubsReq := '4d534746560000000100000001000000130000001300000001004f0305000010000000d5deaf3a32bf386ea128bece2e62a246a0518486e561d3011300000000000000000000000000000000000001000000f90c0700'O;

-  const octetstring encodedBinaryDeleteSubsResp := '4d5347464000000058290600010000002b0000002e00000001005203580c66dad369d3016d420f00000000000000000000000000010000000000000000000000'O;

-

-  const octetstring encodedBinaryClodeSessionReq := '4d5347464f000000010000000100000014000000140000000100d90105000010000000d5deaf3a32bf386ea128bece2e62a246e0408c86e561d3011400000000000000000000000000000000000001'O;

-  const octetstring encodedBinaryClodeSessionResp := '4d53474634000000010000000100000014000000140000000100dc01f0d88e86e561d30114000000000000000000000000000000'O;

-

-  const octetstring encodedBinaryTranslateBrowsePathsToNodeIdsReq := '4d53474649010000b6100600010000003a0000000800000001002a020500002000000070746ffff126e654759e4c6cd4e31668ac7af98e50f29fa554171e3ec5a7b462c89f61f18967d30147420f0000000000ffffffff88130000000000070000000102ac2601000000002e000100000f0000004f7074696f6e53657456616c7565730102ae2601000000002e000100000f0000004f7074696f6e53657456616c7565730100200101000000002e000100000f0000004f7074696f6e53657456616c7565730100210101000000002e000100000f0000004f7074696f6e53657456616c7565730102b02601000000002e000100000f0000004f7074696f6e53657456616c7565730100d92d01000000002e000100000f0000004f7074696f6e53657456616c7565730102b22601000000002e000100000f0000004f7074696f6e53657456616c756573'O;

-  const octetstring encodedBinaryTranslateBrowsePathsToNodeIdsResp := '4d53474674000000b610060001000000080000000800000001002d02b88072f18967d30147420f000000000000000000000000000700000000006f800000000000006f800000000000006f800000000000006f800000000000006f800000000000006f800000000000006f800000000000000000'O;

-

-  const octetstring encodedBinarySetPublishingModeReq := '4d53474667000000b610060001000000e8020000b602000001001f030500002000000070746ffff126e654759e4c6cd4e31668ac7af98e50f29fa554171e3ec5a7b462aaf9ce7c8c67d301f5440f0000000000ffffffff10270000000000000100000039690000'O;

-  const octetstring encodedBinarySetPublishingModeResp := '4d53474640000000b610060001000000b3020000b602000001002203bac4e47c8c67d301f5440f00000000000000000000000000010000000000000000000000'O;

-

-  const octetstring encodedBinaryCallReq := '4d53474673000000b12906000100000051010000510100000100c802050000200000009d404fe935df0e7bba3a0bec377b0417f986c7c344e82a93c8416e5d71417abb45b74b8fd969d30119010000ff030000ffffffff00000000000000010000000100cd080100e42c010000000700000000'O;

-  const octetstring encodedBinaryCallResp := '4d5347465d000000b12906000100000053010000510100000100cb022512868fd969d301190100000000000000010000000800000038303238303030300000000100000000002880000000000000000000000000010000000400000000'O;

-

-}

+/////////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2017-2018  Ericsson AB
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+/////////////////////////////////////////////////////////////////////////////////////
+// Contributors:
+// Akos Makovics
+//
+//  File:         UpcUa_Encoded_Messages.ttcn
+//  Rev:          <RnXnn>
+//  Prodnr:       CNL113861
+/////////////////////////////////////////////////////////////////////////////////////
+
+module OpcUa_Encoded_Messages {
+
+  const octetstring encodedBinaryHello := '48454c46530000000000000000000a0000000a000000000000000000330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c65536572766572'O;
+  const octetstring encodedBinaryAck := '41434b461c00000000000000000008000000080000000001ffff0000'O;
+  const octetstring encodedBinaryError := '455252461000000000000280ffffffff'O;
+
+  const octetstring encodedBinaryOpenSecReq := '4f504e4684000000000000002f000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234e6f6e65ffffffffffffffff01000000010000000100be010000d08f18e2a674d3010100000000000000ffffffff00000000000000000000000000000001000000ffffffffc0270900'O;
+  const octetstring encodedBinaryOpenSecResp := '4f504e4687000000080000002f000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234e6f6e65ffffffffffffffff01000000010000000100c101b0ef92d52d68d30101000000000000000000000000000000000000000800000001000000b0ef92d52d68d301c0270900ffffffff'O;
+
+  const octetstring encodedBinaryCloseSecReq := '434c4f4639000000010000000100000015000000150000000100c401000010278f86e561d30115000000000000000000000000000000000000'O;
+  const octetstring encodedBinaryCloseSecResp := ''O;
+
+  const octetstring encodedBinaryGetEndointsReq := '4d53474645000000010000000100000002000000020000000100ac01000080ff6c83e561d3010200000000000000ffffffff00000000000000000000000000000000000000'O;
+  const octetstring encodedBinaryGetEndointsResp := '4d534746de1e0000010000000100000002000000020000000100af01d0c26d83e561d3010200000000000000000000000000000005000000330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba010000002f000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234e6f6e650300000011000000757365726e616d655f626173696332353601000000ffffffffffffffff33000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696332353611000000757365726e616d655f626173696331323801000000ffffffffffffffff38000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234261736963313238527361313509000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0200000038000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696331323852736131350200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0200000033000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c6963792342617369633235360200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0300000038000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696331323852736131350200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0300000033000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c6963792342617369633235360200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903'O;
+
+  const octetstring encodedBinaryCreateSessionReq := '4d534746e5050000020000000100000003000000030000000100cd01000080412932b378d301030000000000000000000000000000000000002800000075726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d536572766572100000004e6f64654f504355412d436c69656e7402100000004e6f64654f504355412d436c69656e74010000000000000000000000000000001c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665720800000053657373696f6e31200000006ad255a998622c70751a698132155b637162d8d0ef28be58a524c3eb0a6059e1b0040000308204ac30820394a003020102020900c1e87463123e0657300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533325a170d3332313031353039323533325a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100a2f976c17a3b097b145184e6de1f51995fe6eba577952fd8645755eb9bc92e3199c087c6d0ef03ad7fd785750615789ab10edcd78f11680f69bb393b91de4f3e70de7428537960b3074d43465bfd6ef3025168e4e1907f94f89cd83ac5033332c7a11aacedc4e104067793b57ebe24c8e9c7c141bf245a4c7f1479ce9252bf450531d448b64b29836ec2b5eb1c60cd8496b3ab5aaa42be5a8d75b4cbafe82432dd4073400d0054c3619a34059c725f1ec045b34a9443b5d83381c378d301720e948bd3e75b801a3f2463c194fbfb4ce75f5444d4eb6577440feec7e8ef03e47c2985c16cb4da310d8c0d2bbb6c3c06a3fbca35b4b18d722d27ecc4f83d218ed70203010001a382017730820173301d0603551d0e04160414117cbf1ee99a7f73ccfea8417052a792bf2a55193081890603551d23048181307f8014117cbf1ee99a7f73ccfea8417052a792bf2a5519a15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900c1e87463123e0657300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100168990e180793fe78ec638c08d6fe2d9d7178806f620c9d853bf6b7465ece3ae285910c46ace3a2c39bee7cade3703a805673621f5f79e3e0e70fcd0c76458d5a566734ab82b1909bda389a14db52e907ca5a17610298bb5d19495e0ab909164e22c18421c33e3141953f2675ec48fc033f3ba5471a85234f477ddb797b470fe8455f3969584e913be62b2a65a0488bb2b6b0b607c1c007209e1a1ea171243d2433e41483716522193e2aec6b3b1d54d36920f0b6da9748f46b7d52472728303a4dd23e2dd140b0ff8f1973de50c9750452138ccf82a4eb93d92fec4bc3381e285a7c13a9f94def9608f7ab21ec928c5f0653a4757e58a6018bfc223177b881400000000004ced4000350c00'O;
+  const octetstring encodedBinaryCreateSessionResp := '4d534746f8230000010000000100000003000000030000000100d001301e7183e561d30103000000000000000000000000000000040100cbdb813cc60c0d8170bf3a500c4ccee905000010000000d5deaf3a32bf386ea128bece2e62a24600000000004ced40200000003db07d198a2ce0ac25f80d25ea4e5039eee69de061e772d2b245c8935e9524f7b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba05000000330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba010000002f000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234e6f6e650300000011000000757365726e616d655f626173696332353601000000ffffffffffffffff33000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696332353611000000757365726e616d655f626173696331323801000000ffffffffffffffff38000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c696379234261736963313238527361313509000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0200000038000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696331323852736131350200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0200000033000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c6963792342617369633235360200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0300000038000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c69637923426173696331323852736131350200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e61727903330000006f70632e7463703a2f2f7a6d616b616b6f2d5669727475616c426f783a343333342f55412f4d794c6974746c655365727665721c00000075726e3a4e6f64654f504355412d5365727665722d64656661756c74100000004e6f64654f504355412d53657276657202090000004e6f64654f5043554100000000000000000000000000000000b0040000308204ac30820394a003020102020900b3387aab46e4ce0d300d06092a864886f70d01010b05003058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354301e170d3137313031393039323533335a170d3332313031353039323533335a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d5445535430820122300d06092a864886f70d01010105000382010f003082010a0282010100b5b1fc382f5e3b675fe309fe0ee60105eff181215e95d6736943a03245aac5091b2675c4b1e5f290b2a5c83dd5fe7b88ab00208edba29646bec37044a127bb63ac28811542b786ad65640c7a099899dd69a7451b6694ad35ebfa62d5e8666a99dc68fc7b850a9ae32f4bbf59bae0a6ab1dd6337464e98aed100536fb0855a239a19caba149a9ab701e199db0cc699ff57983a8339b292c8f7752629a14f109561381b64b55b197104cbfb68a7e4663614f385c1cf264e77b7d1b314c65a9b7baf5309c4c83188b9c3fe63828133300978731d9542b36fbf80be86512ba120bf7bd5760c8a7b99e6408afcfdd28f1c88b8345ae005c4be149e8e5172fd40badcb0203010001a382017730820173301d0603551d0e04160414f6a6881da84bf40dd18d166f0edbf618b2158e1a3081890603551d23048181307f8014f6a6881da84bf40dd18d166f0edbf618b2158e1aa15ca45a3058310b3009060355040613024652310c300a06035504081303494446310e300c06035504071305506172697331123010060355040a13094e6f64654f50435541311730150603550403130e4e6f64654f504355412d54455354820900b3387aab46e4ce0d300c0603551d13040530030101ff300e0603551d0f0101ff040403020106305f06096086480186f842010d0452165053656c665369676e65642043657274696669636174652067656e657261746564206279204e6f64652d4f50435541204365727469666963617465207574696c697479207573696e67206f70656e73736c30470603551d110440303e862875726e3a7a6d616b616b6f2d5669727475616c426f783a4e6f64652d4f504355412d53657276657282127a6d616b616b6f2d5669727475616c426f78300d06092a864886f70d01010b05000382010100a228af44cc977c5cbf636412bafbe98920f24a40d99d0378bf16daf0b062850915c117e859c553b2128d4a9196fd305605a88cedfac5384de4062c05b42853de453297595dc2f6dd4e1aeb7c3f811603d2b77d56d39c18674d9090c78ad45e3b4372656bb110ce192c03a66ffe6a8907d19e16924eb225f80916e965c4748e525123b141ab1d39e43809ccffcff1b5556517d2857a9effa369179662574eca3371afc9353f8c013ff215ee179d50c8f7b0ee41787484e79b641eac24d42e050067e4496ead0f37a4deb3117e0433c46542418ef474f99eb0d068778b93789613b5d7b42e2f9b3c677dcac0fa3c15fb12e7f8dd0bb0fb488b875d4dbaa1899aba0300000033000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412f5365637572697479506f6c6963792342617369633235360200000010000000757365726e616d6550617373776f726401000000ffffffffffffffffffffffff09000000616e6f6e796d6f757300000000ffffffffffffffffffffffff41000000687474703a2f2f6f7063666f756e646174696f6e2e6f72672f55412d50726f66696c652f5472616e73706f72742f75617463702d756173632d756162696e6172790300000000ffffffffffffffff00000004'O;
+
+  const octetstring encodedBinaryActivateSessionReq := '4d5347467c000000020000000100000004000000040000000100d30105000010000000df4bafc3504bcefa06261658743e65a130ef2a32b378d30104000000000000000000000000000000000000ffffffffffffffff000000000000000001004101010d00000009000000616e6f6e796d6f7573ffffffffffffffff'O;
+  const octetstring encodedBinaryActivateSessionResp := '4d53474660000000010000000100000004000000040000000100d60130a68483e561d30104000000000000000000000000000000200000006bbe056e71ce657d6fb6663e600ae2cf61af5383e5b390dbe85ba33aae4a10ab0000000000000000'O;
+
+  const octetstring encodedBinaryBrowseReq := '4d534746750000000100000001000000050000000500000001000f0205000010000000d5deaf3a32bf386ea128bece2e62a24650f48483e561d3010500000000000000000000000000000000000000000000000000000000000000001027000001000000005402000000000001000000003f000000'O;
+  const octetstring encodedBinaryBrowseResp := '4d5347460a0300005829060001000000f6000000f800000001001202d2bfaefad469d30136430f000000000000000000000000000100000000000000ffffffff11000000002d010001000007000000426f6f6c65616e0207000000426f6f6c65616e400000000000002d01000c000006000000537472696e670206000000537472696e67400000000000002d01000d0000080000004461746554696d6502080000004461746554696d65400000000000002d01000e00000400000047756964020400000047756964400000000000002d01000f00000a00000042797465537472696e67020a00000042797465537472696e67400000000000002d01001000000a000000586d6c456c656d656e74020a000000586d6c456c656d656e74400000000000002d0100110000060000004e6f6465496402060000004e6f64654964400000000000002d01001200000e000000457870616e6465644e6f64654964020e000000457870616e6465644e6f64654964400000000000002d01001300000a000000537461747573436f6465020a000000537461747573436f6465400000000000002d01001400000d0000005175616c69666965644e616d65020d0000005175616c69666965644e616d65400000000000002d01001500000d0000004c6f63616c697a656454657874020d0000004c6f63616c697a656454657874400000000000002d0100160000090000005374727563747572650209000000537472756374757265400000000000002d0100170000090000004461746156616c756502090000004461746156616c7565400000000000002d01001900000e000000446961676e6f73746963496e666f020e000000446961676e6f73746963496e666f400000000000002d01001a0000060000004e756d62657202060000004e756d626572400000000000002d01001d00000b000000456e756d65726174696f6e020b000000456e756d65726174696f6e400000000000002d010102bf2602000f00000056617269616e744461746154797065020f00000056617269616e74446174615479706540000000000000000000'O;
+
+  const octetstring encodedBinaryReadReq := '4d5347467e000000010000000100000007000000070000000100770205000010000000d5deaf3a32bf386ea128bece2e62a246608c8783e561d30107000000000000000000000000000000000000000000000000000002000000010000000301000b000000667265655f6d656d6f72790d000000ffffffff0000ffffffff'O;
+  const octetstring encodedBinaryReadResp:= '4d534746fa0000005829060001000000f5000000f700000001007a02d2bfaefad469d30137430f000000000000000000000000000800000009110018d2bfaefad469d301090640000000d2bfaefad469d301091400000c000000426173654461746154797065d2bfaefad469d3010915020c000000426173654461746154797065d2bfaefad469d301091503000000003300000044657363726962657320612076616c756520746861742063616e206861766520616e792076616c69642044617461547970652ed2bfaefad469d301090700000000d2bfaefad469d301090700000000d2bfaefad469d301090101d2bfaefad469d30100000000'O;
+
+  const octetstring encodedBinaryWriteReq := '4d53474680000000b129060001000000120100001201000001007702050000200000009d404fe935df0e7bba3a0bec377b0417f986c7c344e82a93c8416e5d71417abb7728de11d969d3010d00000000000000ffffffff10270000000000000000000000000003000000010000000100d3080d000000ffffffff0000ffffffff'O;
+  const octetstring encodedBinaryWriteResp := '4d53474642000000b129060001000000140100001201000001007a02ec8d1112d969d3010d0000000000000000000000000000000100000001060000000000000000'O;
+
+  const octetstring encodedBinaryCreateSubscReq := '4d53474664000000010000000100000008000000080000000100130305000010000000d5deaf3a32bf386ea128bece2e62a246f0eb8883e561d301080000000000000000000000000000000000000000000000408f400a000000020000000a000000010a'O;
+  const octetstring encodedBinaryCreateSubscResp := '4d53474648000000010000000100000008000000080000000100160340029183e561d30108000000000000000000000000000000f90c07000000000000408f400a00000002000000'O;
+
+  const octetstring encodedBinaryCreateMonitoredItemReq := '4d53474692000000010000000100000009000000090000000100ef0205000010000000d5deaf3a32bf386ea128bece2e62a24670779183e561d30109000000000000000000000000000000000000f90c070002000000010000000301000b000000667265655f6d656d6f72790d000000ffffffff0000ffffffff020000000100000000000000000059400000000a00000001'O;
+  const octetstring encodedBinaryCreateMonitoredItemResp := '4d53474653000000010000000100000009000000090000000100f202e0889283e561d301090000000000000000000000000000000100000000000000010000000000000000408f400a00000000000000000000'O;
+
+  const octetstring encodedBinarySetMonitoringModeReq := '4d5347466e0000000321060001000000d9000000a700000001000103050000200000009bde93aaa343bd63632e3d509ed586eb5f904133020df86dd2fdd34b4521c61fa7f6fc16ef68d301e6420f0000000000ffffffff10270000000000756a00000100000001000000783f0200'O;
+  const octetstring encodedBinarySetMonitoringModeResp := '4d534746400000000321060001000000a4000000a700000001000403e9281a17ef68d301e6420f00000000000000000000000000010000000000000000000000'O;
+
+  const octetstring encodedBinaryModifyMonitoredItemReq := '4d534746a1010000b12906000100000018020000180200000100fb02050000200000009d404fe935df0e7bba3a0bec377b0417f986c7c344e82a93c8416e5d71417abb02422221da69d301a8010000ff030000ffffffff000000000000009c6b000002000000010000000f5802000400000000000000003091400100d7020119010000090000000100f907010000000000070000004576656e7449640d000000ffffffff0100f907010000000000090000004576656e74547970650d000000ffffffff0100f9070100000000000a000000536f757263654e6f64650d000000ffffffff0100f9070100000000000a000000536f757263654e616d650d000000ffffffff0100f9070100000000000400000054696d650d000000ffffffff0100f9070100000000000b0000005265636569766554696d650d000000ffffffff0100f907010000000000090000004c6f63616c54696d650d000000ffffffff0100f907010000000000070000004d6573736167650d000000ffffffff0100f9070100000000000800000053657665726974790d000000ffffffff000000000000000000'O;
+  const octetstring encodedBinaryModifyMonitoredItemResp := '4d5347464f0000000321060001000000ab000000ae0000000100fe02ed2d201def68d301ed420f00000000000000000000000000010000000000458000000000000000000000000000000000000000'O;
+
+  const octetstring encodedBinaryPublishReq := '4d53474662000000b610060001000000630100003101000001003a030500002000000070746ffff126e654759e4c6cd4e31668ac7af98e50f29fa554171e3ec5a7b4623d8948378b67d30170430f0000000000ffffffff60ea0000000000ffffffff'O;
+  const octetstring encodedBinaryPublishResp := '4d5347465500000058290600010000003b0000003900000001003d0300919eebd369d30178420f00000000000000000000000000846b000000000000000100000000919eebd369d301000000000000000000000000'O;
+
+  const octetstring encodedBinaryDeleteSubsReq := '4d534746560000000100000001000000130000001300000001004f0305000010000000d5deaf3a32bf386ea128bece2e62a246a0518486e561d3011300000000000000000000000000000000000001000000f90c0700'O;
+  const octetstring encodedBinaryDeleteSubsResp := '4d5347464000000058290600010000002b0000002e00000001005203580c66dad369d3016d420f00000000000000000000000000010000000000000000000000'O;
+
+  const octetstring encodedBinaryClodeSessionReq := '4d5347464f000000010000000100000014000000140000000100d90105000010000000d5deaf3a32bf386ea128bece2e62a246e0408c86e561d3011400000000000000000000000000000000000001'O;
+  const octetstring encodedBinaryClodeSessionResp := '4d53474634000000010000000100000014000000140000000100dc01f0d88e86e561d30114000000000000000000000000000000'O;
+
+  const octetstring encodedBinaryTranslateBrowsePathsToNodeIdsReq := '4d53474649010000b6100600010000003a0000000800000001002a020500002000000070746ffff126e654759e4c6cd4e31668ac7af98e50f29fa554171e3ec5a7b462c89f61f18967d30147420f0000000000ffffffff88130000000000070000000102ac2601000000002e000100000f0000004f7074696f6e53657456616c7565730102ae2601000000002e000100000f0000004f7074696f6e53657456616c7565730100200101000000002e000100000f0000004f7074696f6e53657456616c7565730100210101000000002e000100000f0000004f7074696f6e53657456616c7565730102b02601000000002e000100000f0000004f7074696f6e53657456616c7565730100d92d01000000002e000100000f0000004f7074696f6e53657456616c7565730102b22601000000002e000100000f0000004f7074696f6e53657456616c756573'O;
+  const octetstring encodedBinaryTranslateBrowsePathsToNodeIdsResp := '4d53474674000000b610060001000000080000000800000001002d02b88072f18967d30147420f000000000000000000000000000700000000006f800000000000006f800000000000006f800000000000006f800000000000006f800000000000006f800000000000006f800000000000000000'O;
+
+  const octetstring encodedBinarySetPublishingModeReq := '4d53474667000000b610060001000000e8020000b602000001001f030500002000000070746ffff126e654759e4c6cd4e31668ac7af98e50f29fa554171e3ec5a7b462aaf9ce7c8c67d301f5440f0000000000ffffffff10270000000000000100000039690000'O;
+  const octetstring encodedBinarySetPublishingModeResp := '4d53474640000000b610060001000000b3020000b602000001002203bac4e47c8c67d301f5440f00000000000000000000000000010000000000000000000000'O;
+
+  const octetstring encodedBinaryCallReq := '4d53474673000000b12906000100000051010000510100000100c802050000200000009d404fe935df0e7bba3a0bec377b0417f986c7c344e82a93c8416e5d71417abb45b74b8fd969d30119010000ff030000ffffffff00000000000000010000000100cd080100e42c010000000700000000'O;
+  const octetstring encodedBinaryCallResp := '4d5347465d000000b12906000100000053010000510100000100cb022512868fd969d301190100000000000000010000000800000038303238303030300000000100000000002880000000000000000000000000010000000400000000'O;
+
+}
diff --git a/test/OpcUa_Functions.ttcn b/test/OpcUa_Functions.ttcn
index 0805a76..ead34b9 100644
--- a/test/OpcUa_Functions.ttcn
+++ b/test/OpcUa_Functions.ttcn
@@ -1,116 +1,116 @@
-/////////////////////////////////////////////////////////////////////////////////////

-// Copyright (c) 2017-2018  Ericsson AB

-// All rights reserved. This program and the accompanying materials

-// are made available under the terms of the Eclipse Public License v1.0

-// which accompanies this distribution, and is available at

-// http://www.eclipse.org/legal/epl-v10.html

-/////////////////////////////////////////////////////////////////////////////////////

-// Contributors:

-// Akos Makovics

-//

-//  File:         UpcUa_Functions.ttcn

-//  Rev:          <RnXnn>

-//  Prodnr:       CNL113861

-/////////////////////////////////////////////////////////////////////////////////////

-

-module OpcUa_Functions {

-

-  import from IPL4asp_Types all;

-  import from IPL4asp_PortType all;

-

-  type record ConnectionData {

-    charstring  host,           // host name [string]

-    integer     portNumber      // port number [integer]

-  }

-

-  function CreateConnection (

-    IPL4asp_PT              testPort,

-    ConnectionData          local,

-    ConnectionData          remote

-  ) return integer {

-

-    var Result connectionResult;

-    var integer returnValue;

-

-    // connect to the socket and check result

-    connectionResult := f_IPL4_connect(

-      testPort,

-      remote.host, remote.portNumber,

-      local.host, local.portNumber,

-      -1,

-      { tcp := {}},

-      {

-        { reuseAddress := {enable := true} }

-      });

-

-    if (ispresent(connectionResult.errorCode)) {

-      log("  [!!] TCP port connection error: ", connectionResult);

-      returnValue := -1;

-    } else {

-      log("  [::] TCP port [", remote.host, "/", remote.portNumber, "] connected.");

-      returnValue := connectionResult.connId;

-    }

-

-    return returnValue;

-  }

-

-  function CloseConnection (

-    IPL4asp_PT              testPort,

-    integer                 connId

-  ) return boolean {

-

-    var Result closingResult;

-

-    closingResult := f_IPL4_close(testPort, connId, { unspecified := {} });

-

-    if (ispresent(closingResult.errorCode)) {

-      return false;

-    } else {

-      return true;

-    }

-  }

-

-  function SendMessage (

-    IPL4asp_PT              testPort,

-    ConnectionData          remote,

-    integer                 connId,

-    in octetstring          messageToSend

-  ) {

-

-    // send and receive TCP message

-    var ASP_SendTo tcp_msg_send;

-

-    // set up TCP message

-    tcp_msg_send := { connId, remote.host, remote.portNumber, { tcp := {} }, messageToSend }

-

-    // send out TCP message to the given port

-    testPort.send(tcp_msg_send);

-     log("Message sent");

-  }

-

-  function ReceiveMessage (

-    IPL4asp_PT              testPort,

-    inout octetstring       receivedMsg

-  ) return boolean {

-

-    var ASP_RecvFrom tcp_msg_received;

-

-    timer T := 0.1;

-    T.start;

-

-    alt

-    {

-      [] testPort.receive(ASP_RecvFrom : ?) -> value tcp_msg_received {

-        log("TCP message received");

-        receivedMsg := tcp_msg_received.msg;

-        return true;

-      }

-

-      [] T.timeout {

-        log("Timeout, no response");

-      }

-    }

-

-    return false;

-  }

-}

+/////////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2017-2018  Ericsson AB
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+/////////////////////////////////////////////////////////////////////////////////////
+// Contributors:
+// Akos Makovics
+//
+//  File:         UpcUa_Functions.ttcn
+//  Rev:          <RnXnn>
+//  Prodnr:       CNL113861
+/////////////////////////////////////////////////////////////////////////////////////
+
+module OpcUa_Functions {
+
+  import from IPL4asp_Types all;
+  import from IPL4asp_PortType all;
+
+  type record ConnectionData {
+    charstring  host,           // host name [string]
+    integer     portNumber      // port number [integer]
+  }
+
+  function CreateConnection (
+    IPL4asp_PT              testPort,
+    ConnectionData          local,
+    ConnectionData          remote
+  ) return integer {
+
+    var Result connectionResult;
+    var integer returnValue;
+
+    // connect to the socket and check result
+    connectionResult := f_IPL4_connect(
+      testPort,
+      remote.host, remote.portNumber,
+      local.host, local.portNumber,
+      -1,
+      { tcp := {}},
+      {
+        { reuseAddress := {enable := true} }
+      });
+
+    if (ispresent(connectionResult.errorCode)) {
+      log("  [!!] TCP port connection error: ", connectionResult);
+      returnValue := -1;
+    } else {
+      log("  [::] TCP port [", remote.host, "/", remote.portNumber, "] connected.");
+      returnValue := connectionResult.connId;
+    }
+
+    return returnValue;
+  }
+
+  function CloseConnection (
+    IPL4asp_PT              testPort,
+    integer                 connId
+  ) return boolean {
+
+    var Result closingResult;
+
+    closingResult := f_IPL4_close(testPort, connId, { unspecified := {} });
+
+    if (ispresent(closingResult.errorCode)) {
+      return false;
+    } else {
+      return true;
+    }
+  }
+
+  function SendMessage (
+    IPL4asp_PT              testPort,
+    ConnectionData          remote,
+    integer                 connId,
+    in octetstring          messageToSend
+  ) {
+
+    // send and receive TCP message
+    var ASP_SendTo tcp_msg_send;
+
+    // set up TCP message
+    tcp_msg_send := { connId, remote.host, remote.portNumber, { tcp := {} }, messageToSend }
+
+    // send out TCP message to the given port
+    testPort.send(tcp_msg_send);
+     log("Message sent");
+  }
+
+  function ReceiveMessage (
+    IPL4asp_PT              testPort,
+    inout octetstring       receivedMsg
+  ) return boolean {
+
+    var ASP_RecvFrom tcp_msg_received;
+
+    timer T := 0.1;
+    T.start;
+
+    alt
+    {
+      [] testPort.receive(ASP_RecvFrom : ?) -> value tcp_msg_received {
+        log("TCP message received");
+        receivedMsg := tcp_msg_received.msg;
+        return true;
+      }
+
+      [] T.timeout {
+        log("Timeout, no response");
+      }
+    }
+
+    return false;
+  }
+}
diff --git a/test/OpcUa_Message_Templates.ttcn b/test/OpcUa_Message_Templates.ttcn
index 29ea43e..f9684f1 100644
--- a/test/OpcUa_Message_Templates.ttcn
+++ b/test/OpcUa_Message_Templates.ttcn
@@ -1,1003 +1,1003 @@
-/////////////////////////////////////////////////////////////////////////////////////

-// Copyright (c) 2017-2018  Ericsson AB

-// All rights reserved. This program and the accompanying materials

-// are made available under the terms of the Eclipse Public License v1.0

-// which accompanies this distribution, and is available at

-// http://www.eclipse.org/legal/epl-v10.html

-/////////////////////////////////////////////////////////////////////////////////////

-// Contributors:

-// Akos Makovics

-//

-//  File:         UpcUa_Message_Templates.ttcn

-//  Rev:          <RnXnn>

-//  Prodnr:       CNL113861

-/////////////////////////////////////////////////////////////////////////////////////

-

-module OpcUa_Message_Templates {

-

-  import from OpcUa_Types_Binary all;

-  import from OpcUa_Templates_Binary all;

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                       General                           //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  template MessageChunk tr_baseResponseMessage := {

-    header := ?,

-    transportMessage := *,

-    securityChannelId := *,

-    securePolicyUri := *,

-    senderCertificate := *,

-    receiverCertificateThumbprint := *,

-    securityTokenId := *,

-    sequenceHeader := *,

-    body := *

-  }

-

-  const RequestHeader reqHeader := {

-    authenticationToken := {

-      mask := 0,

-	  namespaceUriBit := 0,

-	  serverIndexBit := 0,

-      reservedBit1 := 0,

-	  reservedBit2 := 0,

-	  IdType := {

-	    twoByte := {

-	      nodeValue := 0

-	    }

-      }

-    },

-    timestamp := 131556452504050000,

-    requestHandle := 4,

-    returnDiagnostics := 0,

-    auditEntryId := { nullString := { arrayLength := -2147483647 } },

-    timeoutHint := 0,

-    additionalHeader := {

-      typeId := {

-        node := {

-	      mask := 0,

-	      namespaceUriBit := 0,

-	  	  serverIndexBit := 0,

-		  reservedBit1 := 0,

-		  reservedBit2 := 0,

-		  IdType := {

-		    twoByte := {

-		      nodeValue := 0

-	        }

-	      }

-	    },

-	    namespaceUri := omit,

-	    serverIndex := omit

-	  },

-	  Value := 0

-    }

-  }

-

-  const RequestHeader reqHeaderFourByte := {

-    authenticationToken := {

-      mask := 5,

-      namespaceUriBit := 0,

-      serverIndexBit := 0,

-      reservedBit1 := 0,

-      reservedBit2 := 0,

-      IdType := {

-        byteString := {

-          nameSpace := 0,

-          nodeValue := {

-            realByteString := {

-		      lengthValue := 16,

-			  byteStringValue := { 213, 222, 175, 58, 50, 191, 56, 110, 161, 40, 190, 206, 46, 98, 162, 70 }

-            }

-		  }

-        }

-      }

-    },

-    timestamp := 131556452504610000,

-    requestHandle := 4,

-    returnDiagnostics := 0,

-    auditEntryId := {

-      realString := {

-        stringLength := 0,

-        stringValue := ""

-      }

-    },

-    timeoutHint := 0,

-    additionalHeader := {

-      typeId := {

-        node := {

-          mask := 0,

-          namespaceUriBit := 0,

-          serverIndexBit := 0,

-          reservedBit1 := 0,

-          reservedBit2 := 0,

-          IdType := {

-            twoByte := {

-              nodeValue := 0

-            }

-          }

-        },

-        namespaceUri := omit,

-        serverIndex := omit

-      },

-      Value := 0

-    }

-  }

-

-  const ResponseHeader respHeader := {

-    timestamp := 131563360189870000,

-    requestHandle := 1,

-    serviceResult := 0,

-    serviceDiagnostics := {

-      symbolicIdBit := 0,

-      namespaceUriBit := 0,

-      localeBit := 0,

-      localisedTextBit := 0,

-      additionalInfoBit := 0,

-      innerStatusCodeBit := 0,

-      innerDiagnosticInfoBit := 0,

-      reserveBit := 0,

-      symbolicId := omit,

-      namespaceUri := omit,

-      locale := omit,

-      localisedText := omit,

-      additionalInfo := omit,

-      innerStatusCode := omit,

-      innerDiagnosticInfo := omit

-    },

-    stringTable := {

-      realArray := {

-        arrayLength := 0,

-        arrayValues := { }

-      }

-    },

-    additionalHeader := {

-      typeId := {

-        node := {

-          mask := 0,

-          namespaceUriBit := 0,

-          serverIndexBit := 0,

-          reservedBit1 := 0,

-          reservedBit2 := 0,

-          IdType := {

-            twoByte := {

-              nodeValue := 0

-            }

-          }

-        },

-        namespaceUri := omit,

-        serverIndex := omit

-      },

-      Value := 0

-    }

-  }

-

-  template UserTokenPolicy userTokenPolicy := {

-      policyId := valueof(tr_String("username_basic256")),

-      tokenType := USERNAME_1,

-      issuedTokenType := valueof(tr_StringNull),

-      issuerEndpointUrl := valueof(tr_StringNull),

-      securityPolicyUri := valueof(tr_String("http://opcfoundation.org/UA/SecurityPolicy#Basic256"))

-    }

-

-  template EndpointDescription endpointDesc := {

-    endpointUrl := valueof(tr_String("opc.tcp://zmakako-VirtualBox:4334/UA/MyLittleServer")),

-    server := {

-      applicationUri := valueof(tr_String("urn:NodeOPCUA-Server-default")),

-      productUri := valueof(tr_String("NodeOPCUA-Server")),

-      applicationName := {

-        localeBit := 0,

-        textBit := 1,

-        spareBit1 := 0,

-        spareBit2 := 0,

-        spareBit3 := 0,

-        spareBit4 := 0,

-        spareBit5 := 0,

-        spareBit6 := 0,

-        locale := omit,

-        text := valueof(tr_String("NodeOPCUA"))

-      },

-      applicationType := SERVER_0,

-      gatewayServerUri := valueof(tr_String("")),

-      discoveryProfileUri := valueof(tr_String("")),

-      discoveryUrls := valueof(tr_ListOfString( {} ))

-    },

-    serverCertificate := valueof(tr_ByteString( {48, 130, 4} )),

-    securityMode := NONE_1,

-    securityPolicyUri := valueof(tr_String("http://opcfoundation.org/UA/SecurityPolicy#None")),

-    userIdentityTokens := valueof(tr_ListOfUserTokenPolicy( {valueof(userTokenPolicy)} )),

-    transportProfileUri := valueof(tr_String("http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary")),

-    securityLevel := 3

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                     Hello Message                       //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetHelloMessage() return octetstring {

-    var MessageHeader v_header := valueof(tr_HeaderHello);

-

-    var HelloMessage v_body := {

-      version := 0,

-      receiveBufferSize := 655360,

-      sendBufferSize := 655360,

-      maxMessageSize := 0,

-      maxChunkCount := 0,

-      endPointUrl := valueof(tr_String("opc.tcp://zmakako-VirtualBox:4334/UA/MyLittleServer"))

-    }

-

-    var MessageChunk v_msg := valueof(tr_MessageHello(v_header, v_body));

-

-    return enc_MessageChunk (v_msg);

-  }

-

-

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                      Ack Message                        //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetAckMessage() return template MessageChunk {

-

-    template MessageChunk responseChunk modifies tr_baseResponseMessage := {

-      header := {

-        messageType := AckHeaderMsgType,

-        chunkType := FinalChunk,

-        messageSize := ?

-      }

-    }

-

-    return responseChunk;

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                OpenSecureChannelRequest                 //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetOpenSecureChannelRequest() return octetstring {

-    var MessageHeader v_header := valueof(tr_HeaderOpenSecureChannel);

-

-    var UInt32 v_securityChannelId := 0;

-    var ListOfByte v_securePolicyUri := valueof(tr_ListOfByte({ 104, 116, 116, 112, 58, 47, 47, 111, 112, 99, 102, 111, 117, 110, 100, 97, 116, 105, 111, 110, 46, 111, 114, 103, 47, 85, 65, 47, 83, 101, 99, 117, 114, 105, 116, 121, 80, 111, 108, 105, 99, 121, 35, 78, 111, 110, 101 }));

-    var ListOfByte v_senderCertificate := valueof(tr_ListOfByteNull);

-    var ListOfByte v_receiverCertificateThumbprint := valueof(tr_ListOfByteNull);

-    var SequenceHeader v_sequenceHeader := {

-      SequenceNumber := 1,

-      RequestId := 1

-    }

-

-    var OpenSecureChannelRequest v_openSecReq := {

-      requestHeader := reqHeader,

-      clientProtocolVersion := 0,

-      requestType := ISSUE_0,

-      securityMode := NONE_1,

-      clientNonce := valueof(tr_ByteStringNull),

-      requestedLifetime := 600000

-    }

-

-    var ServiceBody v_service := {

-      encodingByte := 1,

-      namespaceIndex := 0,

-      nodeValue := 0,

-      list := {

-        OpenSecureChannelRequest := v_openSecReq

-      }

-    }

-

-    var octetstring v_encodedBody := enc_ServiceBody(v_service);

-

-    var MessageChunk v_msg := valueof(tr_MessageOpenSecureChannel(v_header, v_securityChannelId, v_securePolicyUri, v_senderCertificate, v_receiverCertificateThumbprint, v_sequenceHeader, v_encodedBody));

-    return enc_MessageChunk (v_msg);

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                OpenSecureChannelResponse                //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetOpenSecureChannelResponse() return template MessageChunk {

-

-    template MessageChunk responseChunk modifies tr_baseResponseMessage := {

-      header := {

-        messageType := OpenSecureChannelMsgType,

-        chunkType := FinalChunk,

-        messageSize := ?

-      }

-    }

-

-    return responseChunk;

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                    GetEndpointsRequest                  //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetEndpointsRequest() return octetstring {

-    var MessageHeader v_header := valueof(tr_HeaderService);

-

-    var UInt32 v_securityChannelId := 1;

-    var UInt32 v_securityTokenId := 1

-    var SequenceHeader v_sequenceHeader := {

-      SequenceNumber := 2,

-      RequestId := 2

-    }

-

-    var GetEndpointsRequest v_getEndpointsReq := {

-      requestHeader := reqHeader,

-      endpointUrl := valueof(tr_String( "" )),

-      localeIds := valueof(tr_ListOfLocaleId ( {} )),

-      profileUris := valueof(tr_ListOfString ( {} ))

-    }

-

-    var ServiceBody v_service := {

-      encodingByte := 1,

-      namespaceIndex := 0,

-      nodeValue := 0,

-      list := {

-        GetEndpointsRequest := v_getEndpointsReq

-      }

-    }

-

-    var octetstring v_encodedBody := enc_ServiceBody(v_service);

-    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));

-    return enc_MessageChunk (v_msg);

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                 CreateSessionRequest                    //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetCreateSessionRequest() return octetstring {

-    var MessageHeader v_header := valueof(tr_HeaderService);

-

-    var UInt32 v_securityChannelId := 1;

-    var UInt32 v_securityTokenId := 1

-    var SequenceHeader v_sequenceHeader := {

-      SequenceNumber := 3,

-      RequestId := 3

-    }

-

-    var CreateSessionRequest v_createSessionReq := {

-      requestHeader := reqHeader,

-      clientDescription := {

-        applicationUri := valueof(tr_String( "urn:zmakako-VirtualBox:Node-OPCUA-Server" )),

-        productUri := valueof(tr_String( "NodeOPCUA-Client" )),

-        applicationName := {

-          localeBit := 0,

-          textBit := 1,

-          spareBit1 := 0,

-          spareBit2 := 0,

-          spareBit3 := 0,

-          spareBit4 := 0,

-          spareBit5 := 0,

-          spareBit6 := 0,

-          locale := omit,

-          text := valueof(tr_String( "NodeOPCUA-Client" ))

-        },

-        applicationType := CLIENT_1,

-        gatewayServerUri := valueof(tr_String( "" )),

-        discoveryProfileUri := valueof(tr_String( "" )),

-        discoveryUrls := valueof(tr_ListOfString({}))

-      },

-      serverUri := valueof(tr_String( "urn:NodeOPCUA-Server-default" )),

-      endpointUrl := valueof(tr_String( "opc.tcp://zmakako-VirtualBox:4334/UA/MyLittleServer" )),

-      sessionName := valueof(tr_String( "Session1" )),

-      clientNonce := valueof(tr_ByteString( {103, 70, 147, 188, 171, 213, 166, 143, 188, 174, 139, 130, 248, 135, 93, 222, 115, 134, 67, 84, 89, 51, 182, 246, 95, 47, 244, 69, 162, 87, 120, 54} )),

-      clientCertificate := valueof(tr_ByteString( { 48, 130, 4, 172, 48, 130, 3, 148, 160, 3, 2, 1, 2, 2, 9, 0, 193, 232, 116, 99, 18, 62, 6, 87, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 11, 5, 0, 48, 88, 49, 11, 48, 9, 6, 3, 85, 4, 6, 19, 2, 70, 82, 49, 12, 48, 10, 6, 3, 85, 4, 8, 19, 3, 73, 68, 70, 49, 14, 48, 12, 6, 3, 85, 4, 7, 19, 5, 80, 97, 114, 105, 115, 49, 18, 48, 16, 6, 3, 85, 4, 10, 19, 9, 78, 111, 100, 101, 79, 80, 67, 85, 65, 49, 23, 48, 21, 6, 3, 85, 4, 3, 19, 14, 78, 111, 100, 101, 79, 80, 67, 85, 65, 45, 84, 69, 83, 84, 48, 30, 23, 13, 49, 55, 49, 48, 49, 57, 48, 57, 50, 53, 51, 50, 90, 23, 13, 51, 50, 49, 48, 49, 53, 48, 57, 50, 53, 51, 50, 90, 48, 88, 49, 11, 48, 9, 6, 3, 85, 4, 6, 19, 2, 70, 82, 49, 12, 48, 10, 6, 3, 85, 4, 8, 19, 3, 73, 68, 70, 49, 14, 48, 12, 6, 3, 85, 4, 7, 19, 5, 80, 97, 114, 105, 115, 49, 18, 48, 16, 6, 3, 85, 4, 10, 19, 9, 78, 111, 100, 101, 79, 80, 67, 85, 65, 49, 23, 48, 21, 6, 3, 85, 4, 3, 19, 14, 78, 111, 100, 101, 79, 80, 67, 85, 65, 45, 84, 69, 83, 84, 48, 130, 1, 34, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 3, 130, 1, 15, 0, 48, 130, 1, 10, 2, 130, 1, 1, 0, 162, 249, 118, 193, 122, 59, 9, 123, 20, 81, 132, 230, 222, 31, 81, 153, 95, 230, 235, 165, 119, 149, 47, 216, 100, 87, 85, 235, 155, 201, 46, 49, 153, 192, 135, 198, 208, 239, 3, 173, 127, 215, 133, 117, 6, 21, 120, 154, 177, 14, 220, 215, 143, 17, 104, 15, 105, 187, 57, 59, 145, 222, 79, 62, 112, 222, 116, 40, 83, 121, 96, 179, 7, 77, 67, 70, 91, 253, 110, 243, 2, 81, 104, 228, 225, 144, 127, 148, 248, 156, 216, 58, 197, 3, 51, 50, 199, 161, 26, 172, 237, 196, 225, 4, 6, 119, 147, 181, 126, 190, 36, 200, 233, 199, 193, 65, 191, 36, 90, 76, 127, 20, 121, 206, 146, 82, 191, 69, 5, 49, 212, 72, 182, 75, 41, 131, 110, 194, 181, 235, 28, 96, 205, 132, 150, 179, 171, 90, 170, 66, 190, 90, 141, 117, 180, 203, 175, 232, 36, 50, 221, 64, 115, 64, 13, 0, 84, 195, 97, 154, 52, 5, 156, 114, 95, 30, 192, 69, 179, 74, 148, 67, 181, 216, 51, 129, 195, 120, 211, 1, 114, 14, 148, 139, 211, 231, 91, 128, 26, 63, 36, 99, 193, 148, 251, 251, 76, 231, 95, 84, 68, 212, 235, 101, 119, 68, 15, 238, 199, 232, 239, 3, 228, 124, 41, 133, 193, 108, 180, 218, 49, 13, 140, 13, 43, 187, 108, 60, 6, 163, 251, 202, 53, 180, 177, 141, 114, 45, 39, 236, 196, 248, 61, 33, 142, 215, 2, 3, 1, 0, 1, 163, 130, 1, 119, 48, 130, 1, 115, 48, 29, 6, 3, 85, 29, 14, 4, 22, 4, 20, 17, 124, 191, 30, 233, 154, 127, 115, 204, 254, 168, 65, 112, 82, 167, 146, 191, 42, 85, 25, 48, 129, 137, 6, 3, 85, 29, 35, 4, 129, 129, 48, 127, 128, 20, 17, 124, 191, 30, 233, 154, 127, 115, 204, 254, 168, 65, 112, 82, 167, 146, 191, 42, 85, 25, 161, 92, 164, 90, 48, 88, 49, 11, 48, 9, 6, 3, 85, 4, 6, 19, 2, 70, 82, 49, 12, 48, 10, 6, 3, 85, 4, 8, 19, 3, 73, 68, 70, 49, 14, 48, 12, 6, 3, 85, 4, 7, 19, 5, 80, 97, 114, 105, 115, 49, 18, 48, 16, 6, 3, 85, 4, 10, 19, 9, 78, 111, 100, 101, 79, 80, 67, 85, 65, 49, 23, 48, 21, 6, 3, 85, 4, 3, 19, 14, 78, 111, 100, 101, 79, 80, 67, 85, 65, 45, 84, 69, 83, 84, 130, 9, 0, 193, 232, 116, 99, 18, 62, 6, 87, 48, 12, 6, 3, 85, 29, 19, 4, 5, 48, 3, 1, 1, 255, 48, 14, 6, 3, 85, 29, 15, 1, 1, 255, 4, 4, 3, 2, 1, 6, 48, 95, 6, 9, 96, 134, 72, 1, 134, 248, 66, 1, 13, 4, 82, 22, 80, 83, 101, 108, 102, 83, 105, 103, 110, 101, 100, 32, 67, 101, 114, 116, 105, 102, 105, 99, 97, 116, 101, 32, 103, 101, 110, 101, 114, 97, 116, 101, 100, 32, 98, 121, 32, 78, 111, 100, 101, 45, 79, 80, 67, 85, 65, 32, 67, 101, 114, 116, 105, 102, 105, 99, 97, 116, 101, 32, 117, 116, 105, 108, 105, 116, 121, 32, 117, 115, 105, 110, 103, 32, 111, 112, 101, 110, 115, 115, 108, 48, 71, 6, 3, 85, 29, 17, 4, 64, 48, 62, 134, 40, 117, 114, 110, 58, 122, 109, 97, 107, 97, 107, 111, 45, 86, 105, 114, 116, 117, 97, 108, 66, 111, 120, 58, 78, 111, 100, 101, 45, 79, 80, 67, 85, 65, 45, 83, 101, 114, 118, 101, 114, 130, 18, 122, 109, 97, 107, 97, 107, 111, 45, 86, 105, 114, 116, 117, 97, 108, 66, 111, 120, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 11, 5, 0, 3, 130, 1, 1, 0, 22, 137, 144, 225, 128, 121, 63, 231, 142, 198, 56, 192, 141, 111, 226, 217, 215, 23, 136, 6, 246, 32, 201, 216, 83, 191, 107, 116, 101, 236, 227, 174, 40, 89, 16, 196, 106, 206, 58, 44, 57, 190, 231, 202, 222, 55, 3, 168, 5, 103, 54, 33, 245, 247, 158, 62, 14, 112, 252, 208, 199, 100, 88, 213, 165, 102, 115, 74, 184, 43, 25, 9, 189, 163, 137, 161, 77, 181, 46, 144, 124, 165, 161, 118, 16, 41, 139, 181, 209, 148, 149, 224, 171, 144, 145, 100, 226, 44, 24, 66, 28, 51, 227, 20, 25, 83, 242, 103, 94, 196, 143, 192, 51, 243, 186, 84, 113, 168, 82, 52, 244, 119, 221, 183, 151, 180, 112, 254, 132, 85, 243, 150, 149, 132, 233, 19, 190, 98, 178, 166, 90, 4, 136, 187, 43, 107, 11, 96, 124, 28, 0, 114, 9, 225, 161, 234, 23, 18, 67, 210, 67, 62, 65, 72, 55, 22, 82, 33, 147, 226, 174, 198, 179, 177, 213, 77, 54, 146, 15, 11, 109, 169, 116, 143, 70, 183, 213, 36, 114, 114, 131, 3, 164, 221, 35, 226, 221, 20, 11, 15, 248, 241, 151, 61, 229, 12, 151, 80, 69, 33, 56, 204, 248, 42, 78, 185, 61, 146, 254, 196, 188, 51, 129, 226, 133, 167, 193, 58, 159, 148, 222, 249, 96, 143, 122, 178, 30, 201, 40, 197, 240, 101, 58, 71, 87, 229, 138, 96, 24, 191, 194, 35, 23, 123, 136, 20} )),

-      requestedSessionTimeout := 60000.0,

-      maxResponseMessageSize := 800000

-    }

-

-    var ServiceBody v_service := {

-      encodingByte := 1,

-      namespaceIndex := 0,

-      nodeValue := 0,

-      list := {

-        CreateSessionRequest := v_createSessionReq

-      }

-    }

-

-    var octetstring v_encodedBody := enc_ServiceBody(v_service);

-    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));

-

-    return enc_MessageChunk (v_msg);

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                ActivateSessionRequest                   //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetActivateSessionRequest() return octetstring {

-    var MessageHeader v_header := valueof(tr_HeaderService);

-

-    var UInt32 v_securityChannelId := 1;

-    var UInt32 v_securityTokenId := 1

-    var SequenceHeader v_sequenceHeader := {

-      SequenceNumber := 4,

-      RequestId := 4

-    }

-

-    var ActivateSessionRequest v_activateSessionReq := {

-      requestHeader := reqHeaderFourByte,

-      clientSignature := {

-        algorithm := valueof(tr_StringNull),

-        Signature := valueof(tr_ByteStringNull)

-      },

-      clientSoftwareCertificates := valueof(tr_ListOfSignedSoftwareCertificate({})),

-      localeIds := valueof(tr_ListOfLocaleId({})),

-      userIdentityToken := {

-        encodingByte := 1,

-        twoByteNodeValue := omit,

-        namespaceIndex := 0,

-        fourByteNodeValue := 321,

-        encoding := 1,

-        parameterLength := 13,

-        extensibleParameterBody := {

-          anonymousIdentityToken := {

-            policyId := valueof(tr_String( "anonymous"))

-          }

-        }

-      },

-      userTokenSignature := {

-        algorithm := valueof(tr_StringNull),

-        Signature := valueof(tr_ByteStringNull)

-      }

-    }

-

-    var ServiceBody v_service := {

-      encodingByte := 1,

-      namespaceIndex := 0,

-      nodeValue := 0,

-      list := {

-        ActivateSessionRequest := v_activateSessionReq

-      }

-    }

-

-    var octetstring v_encodedBody := enc_ServiceBody(v_service);

-    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));

-

-

-    var octetstring res := enc_MessageChunk (v_msg);

-    log (lengthof(res));

-    log("=======================");

-

-    return enc_MessageChunk (v_msg);

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                    BrowseRequest                        //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetBrowseRequest() return octetstring {

-    var MessageHeader v_header := valueof(tr_HeaderService);

-

-    var UInt32 v_securityChannelId := 1;

-    var UInt32 v_securityTokenId := 1

-    var SequenceHeader v_sequenceHeader := {

-      SequenceNumber := 5,

-      RequestId := 5

-    }

-

-    var BrowseRequest v_browseReq := {

-      requestHeader := {

-        authenticationToken := {

-          mask := 5,

-          namespaceUriBit := 0,

-          serverIndexBit := 0,

-          reservedBit1 := 0,

-          reservedBit2 := 0,

-          IdType := {

-            byteString := {

-              nameSpace := 0,

-              nodeValue := {

-                realByteString := {

-                  lengthValue := 16,

-                  byteStringValue := {

-                    213,

-                    222,

-                    175,

-                    58,

-                    50,

-                    191,

-                    56,

-                    110,

-                    161,

-                    40,

-                    190,

-                    206,

-                    46,

-                    98,

-                    162,

-                    70

-                  }

-                }

-              }

-            }

-          }

-        },

-        timestamp := 131556452505810000,

-        requestHandle := 5,

-        returnDiagnostics := 0,

-        auditEntryId := {

-          realString := {

-            stringLength := 0,

-            stringValue := ""

-          }

-        },

-        timeoutHint := 0,

-        additionalHeader := {

-          typeId := {

-            node := {

-              mask := 0,

-              namespaceUriBit := 0,

-              serverIndexBit := 0,

-              reservedBit1 := 0,

-              reservedBit2 := 0,

-              IdType := {

-                twoByte := {

-                  nodeValue := 0

-                }

-              }

-            },

-            namespaceUri := omit,

-            serverIndex := omit

-          },

-          Value := 0

-        }

-      },

-      view := {

-        viewId := {

-          mask := 0,

-          namespaceUriBit := 0,

-          serverIndexBit := 0,

-          reservedBit1 := 0,

-          reservedBit2 := 0,

-          IdType := {

-            twoByte := {

-              nodeValue := 0

-            }

-          }

-        },

-        timestamp := 0,

-        viewVersion := 0

-      },

-      requestedMaxReferencesPerNode := 10000,

-      nodesToBrowse := {

-        realArray := {

-          arrayLength := 1,

-          arrayValues := {

-            {

-              nodeId := {

-                mask := 0,

-                namespaceUriBit := 0,

-                serverIndexBit := 0,

-                reservedBit1 := 0,

-                reservedBit2 := 0,

-                IdType := {

-                  twoByte := {

-                    nodeValue := 84

-                  }

-                }

-              },

-              browseDirection := BOTH_2,

-              referenceTypeId := {

-                mask := 0,

-                namespaceUriBit := 0,

-                serverIndexBit := 0,

-                reservedBit1 := 0,

-                reservedBit2 := 0,

-                IdType := {

-                  twoByte := {

-                    nodeValue := 0

-                  }

-                }

-              },

-              includeSubtypes := 1,

-              nodeClassMask := 0,

-              resultMask := 63

-            }

-          }

-        }

-      }

-    }

-

-    var ServiceBody v_service := {

-      encodingByte := 1,

-      namespaceIndex := 0,

-      nodeValue := 0,

-      list := {

-        BrowseRequest := v_browseReq

-      }

-    }

-

-    var octetstring v_encodedBody := enc_ServiceBody(v_service);

-    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));

-

-    return enc_MessageChunk (v_msg);

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                     ReadRequest                         //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetReadRequest() return octetstring {

-    var MessageHeader v_header := valueof(tr_HeaderService);

-

-    var UInt32 v_securityChannelId := 1;

-    var UInt32 v_securityTokenId := 1

-    var SequenceHeader v_sequenceHeader := {

-      SequenceNumber := 6,

-      RequestId := 6

-    }

-

-    var ReadRequest v_readReq := {

-      requestHeader := {

-        authenticationToken := {

-          mask := 5,

-          namespaceUriBit := 0,

-          serverIndexBit := 0,

-          reservedBit1 := 0,

-          reservedBit2 := 0,

-          IdType := {

-            byteString := {

-              nameSpace := 0,

-              nodeValue := valueof(tr_ByteString( { 213, 222, 175, 58, 50, 191, 56, 110, 161, 40, 190, 206, 46, 98, 162, 70 } ))

-            }

-          }

-        },

-        timestamp := 131556452505980000,

-        requestHandle := 7,

-        returnDiagnostics := 0,

-        auditEntryId := {

-          realString := {

-            stringLength := 0,

-            stringValue := ""

-          }

-        },

-        timeoutHint := 0,

-        additionalHeader := {

-          typeId := {

-            node := {

-              mask := 0,

-              namespaceUriBit := 0,

-              serverIndexBit := 0,

-              reservedBit1 := 0,

-              reservedBit2 := 0,

-              IdType := {

-                twoByte := {

-                  nodeValue := 0

-                }

-              }

-            },

-            namespaceUri := omit,

-            serverIndex := omit

-          },

-          Value := 0

-        }

-      },

-      maxAge := 0.0,

-      timestampsToReturn := BOTH_2,

-      nodesToRead := {

-        realArray := {

-          arrayLength := 1,

-          arrayValues := {

-            {

-              nodeId := {

-                mask := 3,

-                namespaceUriBit := 0,

-                serverIndexBit := 0,

-                reservedBit1 := 0,

-                reservedBit2 := 0,

-                IdType := {

-                  string := {

-                    nameSpace := 1,

-                    nodeValue :=  valueof (tr_String("free_memory"))

-                  }

-                }

-              },

-              attributeId := 13,

-              indexRange := valueof(tr_StringNull),

-              dataEncoding := {

-                namespaceIndex := 0,

-                name :=  valueof(tr_StringNull)

-              }

-            }

-          }

-        }

-      }

-    }

-

-    var ServiceBody v_service := {

-      encodingByte := 1,

-      namespaceIndex := 0,

-      nodeValue := 0,

-      list := {

-        ReadRequest := v_readReq

-      }

-    }

-

-    var octetstring v_encodedBody := enc_ServiceBody(v_service);

-    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));

-

-    return enc_MessageChunk (v_msg);

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //               CreateSubscriptionRequest                 //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetCreateSubscRequest() return octetstring {

-    var MessageHeader v_header := valueof(tr_HeaderService);

-

-    var UInt32 v_securityChannelId := 1;

-    var UInt32 v_securityTokenId := 1

-    var SequenceHeader v_sequenceHeader := {

-      SequenceNumber := 6,

-      RequestId := 6

-    }

-

-    var CreateSubscriptionRequest v_createSubsReq := {

-      requestHeader := {

-        authenticationToken := {

-          mask := 5,

-          namespaceUriBit := 0,

-          serverIndexBit := 0,

-          reservedBit1 := 0,

-          reservedBit2 := 0,

-          IdType := {

-            byteString := {

-              nameSpace := 0,

-              nodeValue := {

-                realByteString := {

-                  lengthValue := 16,

-                  byteStringValue := {

-                    213,

-                    222,

-                    175,

-                    58,

-                    50,

-                    191,

-                    56,

-                    110,

-                    161,

-                    40,

-                    190,

-                    206,

-                    46,

-                    98,

-                    162,

-                    70

-                  }

-                }

-              }

-            }

-          }

-        },

-        timestamp := 131556452506070000,

-        requestHandle := 8,

-        returnDiagnostics := 0,

-        auditEntryId := {

-          realString := {

-            stringLength := 0,

-            stringValue := ""

-          }

-        },

-        timeoutHint := 0,

-        additionalHeader := {

-          typeId := {

-            node := {

-              mask := 0,

-              namespaceUriBit := 0,

-              serverIndexBit := 0,

-              reservedBit1 := 0,

-              reservedBit2 := 0,

-              IdType := {

-                twoByte := {

-                  nodeValue := 0

-                }

-              }

-            },

-            namespaceUri := omit,

-            serverIndex := omit

-          },

-          Value := 0

-        }

-      },

-      requestedPublishingInterval := 100.0,

-      requestedLifetimeCount := 10,

-      requestedMaxKeepAliveCount := 2,

-      maxNotificationsPerPublish := 10,

-      publishingEnabled := 1,

-      priorityInt32 := 10

-    }

-

-    var ServiceBody v_service := {

-      encodingByte := 1,

-      namespaceIndex := 0,

-      nodeValue := 0,

-      list := {

-        CreateSubscriptionRequest := v_createSubsReq

-      }

-    }

-

-    var octetstring v_encodedBody := enc_ServiceBody(v_service);

-    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));

-

-    return enc_MessageChunk (v_msg);

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                   ServiceResponse                       //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetServiceResponse() return template MessageChunk {

-

-    template MessageChunk responseChunk modifies tr_baseResponseMessage := {

-      header := {

-        messageType := ServicesMsgType,

-        chunkType := FinalChunk,

-        messageSize := ?

-      }

-    }

-

-    return responseChunk;

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                   CloseSessionRequest                   //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetCloseSessionRequest() return octetstring {

-    var MessageHeader v_header := valueof(tr_HeaderService);

-

-    var UInt32 v_securityChannelId := 1;

-    var UInt32 v_securityTokenId := 1

-    var SequenceHeader v_sequenceHeader := {

-      SequenceNumber := 21,

-      RequestId := 21

-    }

-

-    var CloseSessionRequest v_closeSessionReq := {

-      requestHeader := {

-        authenticationToken := {

-          mask := 5,

-          namespaceUriBit := 0,

-          serverIndexBit := 0,

-          reservedBit1 := 0,

-          reservedBit2 := 0,

-          IdType := {

-            byteString := {

-              nameSpace := 0,

-              nodeValue := {

-                realByteString := {

-                  lengthValue := 16,

-                  byteStringValue := {

-                    213,

-                    222,

-                    175,

-                    58,

-                    50,

-                    191,

-                    56,

-                    110,

-                    161,

-                    40,

-                    190,

-                    206,

-                    46,

-                    98,

-                    162,

-                    70

-                  }

-                }

-              }

-            }

-          }

-        },

-        timestamp := 131556452556620000,

-        requestHandle := 20,

-        returnDiagnostics := 0,

-        auditEntryId := {

-          realString := {

-            stringLength := 0,

-            stringValue := ""

-          }

-        },

-        timeoutHint := 0,

-        additionalHeader := {

-          typeId := {

-            node := {

-              mask := 0,

-              namespaceUriBit := 0,

-              serverIndexBit := 0,

-              reservedBit1 := 0,

-              reservedBit2 := 0,

-              IdType := {

-                twoByte := {

-                  nodeValue := 0

-                }

-              }

-            },

-            namespaceUri := omit,

-            serverIndex := omit

-          },

-          Value := 0

-        }

-      },

-      deleteSubscriptions := 1

-    }

-

-    var ServiceBody v_service := {

-      encodingByte := 1,

-      namespaceIndex := 0,

-      nodeValue := 0,

-      list := {

-        CloseSessionRequest := v_closeSessionReq

-      }

-    }

-

-    var octetstring v_encodedBody := enc_ServiceBody(v_service);

-    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));

-

-    return enc_MessageChunk(v_msg);

-  }

-

-  /////////////////////////////////////////////////////////////

-  //                                                         //

-  //                CloseSecureChannelRequest                //

-  //                                                         //

-  /////////////////////////////////////////////////////////////

-

-  function f_GetCloseSecureChannelRequest() return octetstring {

-    var MessageHeader v_header := valueof(tr_HeaderCloseSecureChannel);

-

-    var UInt32 v_securityChannelId := 1;

-    var UInt32 v_securityTokenId := 1

-    var SequenceHeader v_sequenceHeader := {

-      SequenceNumber := 21,

-      RequestId := 21

-    }

-

-    var CloseSecureChannelRequest v_closeSecReq := {

-      requestHeader := reqHeader

-    }

-

-    var ServiceBody v_service := {

-      encodingByte := 1,

-      namespaceIndex := 0,

-      nodeValue := 0,

-      list := {

-        CloseSecureChannelRequest := v_closeSecReq

-      }

-    }

-

-    var octetstring v_encodedBody := enc_ServiceBody(v_service);

-    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));

-

-    return enc_MessageChunk(v_msg);

-  }

-}

+/////////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2017-2018  Ericsson AB
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+/////////////////////////////////////////////////////////////////////////////////////
+// Contributors:
+// Akos Makovics
+//
+//  File:         UpcUa_Message_Templates.ttcn
+//  Rev:          <RnXnn>
+//  Prodnr:       CNL113861
+/////////////////////////////////////////////////////////////////////////////////////
+
+module OpcUa_Message_Templates {
+
+  import from OpcUa_Types_Binary all;
+  import from OpcUa_Templates_Binary all;
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                       General                           //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  template MessageChunk tr_baseResponseMessage := {
+    header := ?,
+    transportMessage := *,
+    securityChannelId := *,
+    securePolicyUri := *,
+    senderCertificate := *,
+    receiverCertificateThumbprint := *,
+    securityTokenId := *,
+    sequenceHeader := *,
+    body := *
+  }
+
+  const RequestHeader reqHeader := {
+    authenticationToken := {
+      mask := 0,
+	  namespaceUriBit := 0,
+	  serverIndexBit := 0,
+      reservedBit1 := 0,
+	  reservedBit2 := 0,
+	  IdType := {
+	    twoByte := {
+	      nodeValue := 0
+	    }
+      }
+    },
+    timestamp := 131556452504050000,
+    requestHandle := 4,
+    returnDiagnostics := 0,
+    auditEntryId := { nullString := { arrayLength := -2147483647 } },
+    timeoutHint := 0,
+    additionalHeader := {
+      typeId := {
+        node := {
+	      mask := 0,
+	      namespaceUriBit := 0,
+	  	  serverIndexBit := 0,
+		  reservedBit1 := 0,
+		  reservedBit2 := 0,
+		  IdType := {
+		    twoByte := {
+		      nodeValue := 0
+	        }
+	      }
+	    },
+	    namespaceUri := omit,
+	    serverIndex := omit
+	  },
+	  Value := 0
+    }
+  }
+
+  const RequestHeader reqHeaderFourByte := {
+    authenticationToken := {
+      mask := 5,
+      namespaceUriBit := 0,
+      serverIndexBit := 0,
+      reservedBit1 := 0,
+      reservedBit2 := 0,
+      IdType := {
+        byteString := {
+          nameSpace := 0,
+          nodeValue := {
+            realByteString := {
+		      lengthValue := 16,
+			  byteStringValue := { 213, 222, 175, 58, 50, 191, 56, 110, 161, 40, 190, 206, 46, 98, 162, 70 }
+            }
+		  }
+        }
+      }
+    },
+    timestamp := 131556452504610000,
+    requestHandle := 4,
+    returnDiagnostics := 0,
+    auditEntryId := {
+      realString := {
+        stringLength := 0,
+        stringValue := ""
+      }
+    },
+    timeoutHint := 0,
+    additionalHeader := {
+      typeId := {
+        node := {
+          mask := 0,
+          namespaceUriBit := 0,
+          serverIndexBit := 0,
+          reservedBit1 := 0,
+          reservedBit2 := 0,
+          IdType := {
+            twoByte := {
+              nodeValue := 0
+            }
+          }
+        },
+        namespaceUri := omit,
+        serverIndex := omit
+      },
+      Value := 0
+    }
+  }
+
+  const ResponseHeader respHeader := {
+    timestamp := 131563360189870000,
+    requestHandle := 1,
+    serviceResult := 0,
+    serviceDiagnostics := {
+      symbolicIdBit := 0,
+      namespaceUriBit := 0,
+      localeBit := 0,
+      localisedTextBit := 0,
+      additionalInfoBit := 0,
+      innerStatusCodeBit := 0,
+      innerDiagnosticInfoBit := 0,
+      reserveBit := 0,
+      symbolicId := omit,
+      namespaceUri := omit,
+      locale := omit,
+      localisedText := omit,
+      additionalInfo := omit,
+      innerStatusCode := omit,
+      innerDiagnosticInfo := omit
+    },
+    stringTable := {
+      realArray := {
+        arrayLength := 0,
+        arrayValues := { }
+      }
+    },
+    additionalHeader := {
+      typeId := {
+        node := {
+          mask := 0,
+          namespaceUriBit := 0,
+          serverIndexBit := 0,
+          reservedBit1 := 0,
+          reservedBit2 := 0,
+          IdType := {
+            twoByte := {
+              nodeValue := 0
+            }
+          }
+        },
+        namespaceUri := omit,
+        serverIndex := omit
+      },
+      Value := 0
+    }
+  }
+
+  template UserTokenPolicy userTokenPolicy := {
+      policyId := valueof(tr_String("username_basic256")),
+      tokenType := USERNAME_1,
+      issuedTokenType := valueof(tr_StringNull),
+      issuerEndpointUrl := valueof(tr_StringNull),
+      securityPolicyUri := valueof(tr_String("http://opcfoundation.org/UA/SecurityPolicy#Basic256"))
+    }
+
+  template EndpointDescription endpointDesc := {
+    endpointUrl := valueof(tr_String("opc.tcp://zmakako-VirtualBox:4334/UA/MyLittleServer")),
+    server := {
+      applicationUri := valueof(tr_String("urn:NodeOPCUA-Server-default")),
+      productUri := valueof(tr_String("NodeOPCUA-Server")),
+      applicationName := {
+        localeBit := 0,
+        textBit := 1,
+        spareBit1 := 0,
+        spareBit2 := 0,
+        spareBit3 := 0,
+        spareBit4 := 0,
+        spareBit5 := 0,
+        spareBit6 := 0,
+        locale := omit,
+        text := valueof(tr_String("NodeOPCUA"))
+      },
+      applicationType := SERVER_0,
+      gatewayServerUri := valueof(tr_String("")),
+      discoveryProfileUri := valueof(tr_String("")),
+      discoveryUrls := valueof(tr_ListOfString( {} ))
+    },
+    serverCertificate := valueof(tr_ByteString( {48, 130, 4} )),
+    securityMode := NONE_1,
+    securityPolicyUri := valueof(tr_String("http://opcfoundation.org/UA/SecurityPolicy#None")),
+    userIdentityTokens := valueof(tr_ListOfUserTokenPolicy( {valueof(userTokenPolicy)} )),
+    transportProfileUri := valueof(tr_String("http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary")),
+    securityLevel := 3
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                     Hello Message                       //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetHelloMessage() return octetstring {
+    var MessageHeader v_header := valueof(tr_HeaderHello);
+
+    var HelloMessage v_body := {
+      version := 0,
+      receiveBufferSize := 655360,
+      sendBufferSize := 655360,
+      maxMessageSize := 0,
+      maxChunkCount := 0,
+      endPointUrl := valueof(tr_String("opc.tcp://zmakako-VirtualBox:4334/UA/MyLittleServer"))
+    }
+
+    var MessageChunk v_msg := valueof(tr_MessageHello(v_header, v_body));
+
+    return enc_MessageChunk (v_msg);
+  }
+
+
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                      Ack Message                        //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetAckMessage() return template MessageChunk {
+
+    template MessageChunk responseChunk modifies tr_baseResponseMessage := {
+      header := {
+        messageType := AckHeaderMsgType,
+        chunkType := FinalChunk,
+        messageSize := ?
+      }
+    }
+
+    return responseChunk;
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                OpenSecureChannelRequest                 //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetOpenSecureChannelRequest() return octetstring {
+    var MessageHeader v_header := valueof(tr_HeaderOpenSecureChannel);
+
+    var UInt32 v_securityChannelId := 0;
+    var ListOfByte v_securePolicyUri := valueof(tr_ListOfByte({ 104, 116, 116, 112, 58, 47, 47, 111, 112, 99, 102, 111, 117, 110, 100, 97, 116, 105, 111, 110, 46, 111, 114, 103, 47, 85, 65, 47, 83, 101, 99, 117, 114, 105, 116, 121, 80, 111, 108, 105, 99, 121, 35, 78, 111, 110, 101 }));
+    var ListOfByte v_senderCertificate := valueof(tr_ListOfByteNull);
+    var ListOfByte v_receiverCertificateThumbprint := valueof(tr_ListOfByteNull);
+    var SequenceHeader v_sequenceHeader := {
+      SequenceNumber := 1,
+      RequestId := 1
+    }
+
+    var OpenSecureChannelRequest v_openSecReq := {
+      requestHeader := reqHeader,
+      clientProtocolVersion := 0,
+      requestType := ISSUE_0,
+      securityMode := NONE_1,
+      clientNonce := valueof(tr_ByteStringNull),
+      requestedLifetime := 600000
+    }
+
+    var ServiceBody v_service := {
+      encodingByte := 1,
+      namespaceIndex := 0,
+      nodeValue := 0,
+      list := {
+        OpenSecureChannelRequest := v_openSecReq
+      }
+    }
+
+    var octetstring v_encodedBody := enc_ServiceBody(v_service);
+
+    var MessageChunk v_msg := valueof(tr_MessageOpenSecureChannel(v_header, v_securityChannelId, v_securePolicyUri, v_senderCertificate, v_receiverCertificateThumbprint, v_sequenceHeader, v_encodedBody));
+    return enc_MessageChunk (v_msg);
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                OpenSecureChannelResponse                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetOpenSecureChannelResponse() return template MessageChunk {
+
+    template MessageChunk responseChunk modifies tr_baseResponseMessage := {
+      header := {
+        messageType := OpenSecureChannelMsgType,
+        chunkType := FinalChunk,
+        messageSize := ?
+      }
+    }
+
+    return responseChunk;
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                    GetEndpointsRequest                  //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetEndpointsRequest() return octetstring {
+    var MessageHeader v_header := valueof(tr_HeaderService);
+
+    var UInt32 v_securityChannelId := 1;
+    var UInt32 v_securityTokenId := 1
+    var SequenceHeader v_sequenceHeader := {
+      SequenceNumber := 2,
+      RequestId := 2
+    }
+
+    var GetEndpointsRequest v_getEndpointsReq := {
+      requestHeader := reqHeader,
+      endpointUrl := valueof(tr_String( "" )),
+      localeIds := valueof(tr_ListOfLocaleId ( {} )),
+      profileUris := valueof(tr_ListOfString ( {} ))
+    }
+
+    var ServiceBody v_service := {
+      encodingByte := 1,
+      namespaceIndex := 0,
+      nodeValue := 0,
+      list := {
+        GetEndpointsRequest := v_getEndpointsReq
+      }
+    }
+
+    var octetstring v_encodedBody := enc_ServiceBody(v_service);
+    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));
+    return enc_MessageChunk (v_msg);
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                 CreateSessionRequest                    //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetCreateSessionRequest() return octetstring {
+    var MessageHeader v_header := valueof(tr_HeaderService);
+
+    var UInt32 v_securityChannelId := 1;
+    var UInt32 v_securityTokenId := 1
+    var SequenceHeader v_sequenceHeader := {
+      SequenceNumber := 3,
+      RequestId := 3
+    }
+
+    var CreateSessionRequest v_createSessionReq := {
+      requestHeader := reqHeader,
+      clientDescription := {
+        applicationUri := valueof(tr_String( "urn:zmakako-VirtualBox:Node-OPCUA-Server" )),
+        productUri := valueof(tr_String( "NodeOPCUA-Client" )),
+        applicationName := {
+          localeBit := 0,
+          textBit := 1,
+          spareBit1 := 0,
+          spareBit2 := 0,
+          spareBit3 := 0,
+          spareBit4 := 0,
+          spareBit5 := 0,
+          spareBit6 := 0,
+          locale := omit,
+          text := valueof(tr_String( "NodeOPCUA-Client" ))
+        },
+        applicationType := CLIENT_1,
+        gatewayServerUri := valueof(tr_String( "" )),
+        discoveryProfileUri := valueof(tr_String( "" )),
+        discoveryUrls := valueof(tr_ListOfString({}))
+      },
+      serverUri := valueof(tr_String( "urn:NodeOPCUA-Server-default" )),
+      endpointUrl := valueof(tr_String( "opc.tcp://zmakako-VirtualBox:4334/UA/MyLittleServer" )),
+      sessionName := valueof(tr_String( "Session1" )),
+      clientNonce := valueof(tr_ByteString( {103, 70, 147, 188, 171, 213, 166, 143, 188, 174, 139, 130, 248, 135, 93, 222, 115, 134, 67, 84, 89, 51, 182, 246, 95, 47, 244, 69, 162, 87, 120, 54} )),
+      clientCertificate := valueof(tr_ByteString( { 48, 130, 4, 172, 48, 130, 3, 148, 160, 3, 2, 1, 2, 2, 9, 0, 193, 232, 116, 99, 18, 62, 6, 87, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 11, 5, 0, 48, 88, 49, 11, 48, 9, 6, 3, 85, 4, 6, 19, 2, 70, 82, 49, 12, 48, 10, 6, 3, 85, 4, 8, 19, 3, 73, 68, 70, 49, 14, 48, 12, 6, 3, 85, 4, 7, 19, 5, 80, 97, 114, 105, 115, 49, 18, 48, 16, 6, 3, 85, 4, 10, 19, 9, 78, 111, 100, 101, 79, 80, 67, 85, 65, 49, 23, 48, 21, 6, 3, 85, 4, 3, 19, 14, 78, 111, 100, 101, 79, 80, 67, 85, 65, 45, 84, 69, 83, 84, 48, 30, 23, 13, 49, 55, 49, 48, 49, 57, 48, 57, 50, 53, 51, 50, 90, 23, 13, 51, 50, 49, 48, 49, 53, 48, 57, 50, 53, 51, 50, 90, 48, 88, 49, 11, 48, 9, 6, 3, 85, 4, 6, 19, 2, 70, 82, 49, 12, 48, 10, 6, 3, 85, 4, 8, 19, 3, 73, 68, 70, 49, 14, 48, 12, 6, 3, 85, 4, 7, 19, 5, 80, 97, 114, 105, 115, 49, 18, 48, 16, 6, 3, 85, 4, 10, 19, 9, 78, 111, 100, 101, 79, 80, 67, 85, 65, 49, 23, 48, 21, 6, 3, 85, 4, 3, 19, 14, 78, 111, 100, 101, 79, 80, 67, 85, 65, 45, 84, 69, 83, 84, 48, 130, 1, 34, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 3, 130, 1, 15, 0, 48, 130, 1, 10, 2, 130, 1, 1, 0, 162, 249, 118, 193, 122, 59, 9, 123, 20, 81, 132, 230, 222, 31, 81, 153, 95, 230, 235, 165, 119, 149, 47, 216, 100, 87, 85, 235, 155, 201, 46, 49, 153, 192, 135, 198, 208, 239, 3, 173, 127, 215, 133, 117, 6, 21, 120, 154, 177, 14, 220, 215, 143, 17, 104, 15, 105, 187, 57, 59, 145, 222, 79, 62, 112, 222, 116, 40, 83, 121, 96, 179, 7, 77, 67, 70, 91, 253, 110, 243, 2, 81, 104, 228, 225, 144, 127, 148, 248, 156, 216, 58, 197, 3, 51, 50, 199, 161, 26, 172, 237, 196, 225, 4, 6, 119, 147, 181, 126, 190, 36, 200, 233, 199, 193, 65, 191, 36, 90, 76, 127, 20, 121, 206, 146, 82, 191, 69, 5, 49, 212, 72, 182, 75, 41, 131, 110, 194, 181, 235, 28, 96, 205, 132, 150, 179, 171, 90, 170, 66, 190, 90, 141, 117, 180, 203, 175, 232, 36, 50, 221, 64, 115, 64, 13, 0, 84, 195, 97, 154, 52, 5, 156, 114, 95, 30, 192, 69, 179, 74, 148, 67, 181, 216, 51, 129, 195, 120, 211, 1, 114, 14, 148, 139, 211, 231, 91, 128, 26, 63, 36, 99, 193, 148, 251, 251, 76, 231, 95, 84, 68, 212, 235, 101, 119, 68, 15, 238, 199, 232, 239, 3, 228, 124, 41, 133, 193, 108, 180, 218, 49, 13, 140, 13, 43, 187, 108, 60, 6, 163, 251, 202, 53, 180, 177, 141, 114, 45, 39, 236, 196, 248, 61, 33, 142, 215, 2, 3, 1, 0, 1, 163, 130, 1, 119, 48, 130, 1, 115, 48, 29, 6, 3, 85, 29, 14, 4, 22, 4, 20, 17, 124, 191, 30, 233, 154, 127, 115, 204, 254, 168, 65, 112, 82, 167, 146, 191, 42, 85, 25, 48, 129, 137, 6, 3, 85, 29, 35, 4, 129, 129, 48, 127, 128, 20, 17, 124, 191, 30, 233, 154, 127, 115, 204, 254, 168, 65, 112, 82, 167, 146, 191, 42, 85, 25, 161, 92, 164, 90, 48, 88, 49, 11, 48, 9, 6, 3, 85, 4, 6, 19, 2, 70, 82, 49, 12, 48, 10, 6, 3, 85, 4, 8, 19, 3, 73, 68, 70, 49, 14, 48, 12, 6, 3, 85, 4, 7, 19, 5, 80, 97, 114, 105, 115, 49, 18, 48, 16, 6, 3, 85, 4, 10, 19, 9, 78, 111, 100, 101, 79, 80, 67, 85, 65, 49, 23, 48, 21, 6, 3, 85, 4, 3, 19, 14, 78, 111, 100, 101, 79, 80, 67, 85, 65, 45, 84, 69, 83, 84, 130, 9, 0, 193, 232, 116, 99, 18, 62, 6, 87, 48, 12, 6, 3, 85, 29, 19, 4, 5, 48, 3, 1, 1, 255, 48, 14, 6, 3, 85, 29, 15, 1, 1, 255, 4, 4, 3, 2, 1, 6, 48, 95, 6, 9, 96, 134, 72, 1, 134, 248, 66, 1, 13, 4, 82, 22, 80, 83, 101, 108, 102, 83, 105, 103, 110, 101, 100, 32, 67, 101, 114, 116, 105, 102, 105, 99, 97, 116, 101, 32, 103, 101, 110, 101, 114, 97, 116, 101, 100, 32, 98, 121, 32, 78, 111, 100, 101, 45, 79, 80, 67, 85, 65, 32, 67, 101, 114, 116, 105, 102, 105, 99, 97, 116, 101, 32, 117, 116, 105, 108, 105, 116, 121, 32, 117, 115, 105, 110, 103, 32, 111, 112, 101, 110, 115, 115, 108, 48, 71, 6, 3, 85, 29, 17, 4, 64, 48, 62, 134, 40, 117, 114, 110, 58, 122, 109, 97, 107, 97, 107, 111, 45, 86, 105, 114, 116, 117, 97, 108, 66, 111, 120, 58, 78, 111, 100, 101, 45, 79, 80, 67, 85, 65, 45, 83, 101, 114, 118, 101, 114, 130, 18, 122, 109, 97, 107, 97, 107, 111, 45, 86, 105, 114, 116, 117, 97, 108, 66, 111, 120, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 11, 5, 0, 3, 130, 1, 1, 0, 22, 137, 144, 225, 128, 121, 63, 231, 142, 198, 56, 192, 141, 111, 226, 217, 215, 23, 136, 6, 246, 32, 201, 216, 83, 191, 107, 116, 101, 236, 227, 174, 40, 89, 16, 196, 106, 206, 58, 44, 57, 190, 231, 202, 222, 55, 3, 168, 5, 103, 54, 33, 245, 247, 158, 62, 14, 112, 252, 208, 199, 100, 88, 213, 165, 102, 115, 74, 184, 43, 25, 9, 189, 163, 137, 161, 77, 181, 46, 144, 124, 165, 161, 118, 16, 41, 139, 181, 209, 148, 149, 224, 171, 144, 145, 100, 226, 44, 24, 66, 28, 51, 227, 20, 25, 83, 242, 103, 94, 196, 143, 192, 51, 243, 186, 84, 113, 168, 82, 52, 244, 119, 221, 183, 151, 180, 112, 254, 132, 85, 243, 150, 149, 132, 233, 19, 190, 98, 178, 166, 90, 4, 136, 187, 43, 107, 11, 96, 124, 28, 0, 114, 9, 225, 161, 234, 23, 18, 67, 210, 67, 62, 65, 72, 55, 22, 82, 33, 147, 226, 174, 198, 179, 177, 213, 77, 54, 146, 15, 11, 109, 169, 116, 143, 70, 183, 213, 36, 114, 114, 131, 3, 164, 221, 35, 226, 221, 20, 11, 15, 248, 241, 151, 61, 229, 12, 151, 80, 69, 33, 56, 204, 248, 42, 78, 185, 61, 146, 254, 196, 188, 51, 129, 226, 133, 167, 193, 58, 159, 148, 222, 249, 96, 143, 122, 178, 30, 201, 40, 197, 240, 101, 58, 71, 87, 229, 138, 96, 24, 191, 194, 35, 23, 123, 136, 20} )),
+      requestedSessionTimeout := 60000.0,
+      maxResponseMessageSize := 800000
+    }
+
+    var ServiceBody v_service := {
+      encodingByte := 1,
+      namespaceIndex := 0,
+      nodeValue := 0,
+      list := {
+        CreateSessionRequest := v_createSessionReq
+      }
+    }
+
+    var octetstring v_encodedBody := enc_ServiceBody(v_service);
+    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));
+
+    return enc_MessageChunk (v_msg);
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                ActivateSessionRequest                   //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetActivateSessionRequest() return octetstring {
+    var MessageHeader v_header := valueof(tr_HeaderService);
+
+    var UInt32 v_securityChannelId := 1;
+    var UInt32 v_securityTokenId := 1
+    var SequenceHeader v_sequenceHeader := {
+      SequenceNumber := 4,
+      RequestId := 4
+    }
+
+    var ActivateSessionRequest v_activateSessionReq := {
+      requestHeader := reqHeaderFourByte,
+      clientSignature := {
+        algorithm := valueof(tr_StringNull),
+        Signature := valueof(tr_ByteStringNull)
+      },
+      clientSoftwareCertificates := valueof(tr_ListOfSignedSoftwareCertificate({})),
+      localeIds := valueof(tr_ListOfLocaleId({})),
+      userIdentityToken := {
+        encodingByte := 1,
+        twoByteNodeValue := omit,
+        namespaceIndex := 0,
+        fourByteNodeValue := 321,
+        encoding := 1,
+        parameterLength := 13,
+        extensibleParameterBody := {
+          anonymousIdentityToken := {
+            policyId := valueof(tr_String( "anonymous"))
+          }
+        }
+      },
+      userTokenSignature := {
+        algorithm := valueof(tr_StringNull),
+        Signature := valueof(tr_ByteStringNull)
+      }
+    }
+
+    var ServiceBody v_service := {
+      encodingByte := 1,
+      namespaceIndex := 0,
+      nodeValue := 0,
+      list := {
+        ActivateSessionRequest := v_activateSessionReq
+      }
+    }
+
+    var octetstring v_encodedBody := enc_ServiceBody(v_service);
+    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));
+
+
+    var octetstring res := enc_MessageChunk (v_msg);
+    log (lengthof(res));
+    log("=======================");
+
+    return enc_MessageChunk (v_msg);
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                    BrowseRequest                        //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetBrowseRequest() return octetstring {
+    var MessageHeader v_header := valueof(tr_HeaderService);
+
+    var UInt32 v_securityChannelId := 1;
+    var UInt32 v_securityTokenId := 1
+    var SequenceHeader v_sequenceHeader := {
+      SequenceNumber := 5,
+      RequestId := 5
+    }
+
+    var BrowseRequest v_browseReq := {
+      requestHeader := {
+        authenticationToken := {
+          mask := 5,
+          namespaceUriBit := 0,
+          serverIndexBit := 0,
+          reservedBit1 := 0,
+          reservedBit2 := 0,
+          IdType := {
+            byteString := {
+              nameSpace := 0,
+              nodeValue := {
+                realByteString := {
+                  lengthValue := 16,
+                  byteStringValue := {
+                    213,
+                    222,
+                    175,
+                    58,
+                    50,
+                    191,
+                    56,
+                    110,
+                    161,
+                    40,
+                    190,
+                    206,
+                    46,
+                    98,
+                    162,
+                    70
+                  }
+                }
+              }
+            }
+          }
+        },
+        timestamp := 131556452505810000,
+        requestHandle := 5,
+        returnDiagnostics := 0,
+        auditEntryId := {
+          realString := {
+            stringLength := 0,
+            stringValue := ""
+          }
+        },
+        timeoutHint := 0,
+        additionalHeader := {
+          typeId := {
+            node := {
+              mask := 0,
+              namespaceUriBit := 0,
+              serverIndexBit := 0,
+              reservedBit1 := 0,
+              reservedBit2 := 0,
+              IdType := {
+                twoByte := {
+                  nodeValue := 0
+                }
+              }
+            },
+            namespaceUri := omit,
+            serverIndex := omit
+          },
+          Value := 0
+        }
+      },
+      view := {
+        viewId := {
+          mask := 0,
+          namespaceUriBit := 0,
+          serverIndexBit := 0,
+          reservedBit1 := 0,
+          reservedBit2 := 0,
+          IdType := {
+            twoByte := {
+              nodeValue := 0
+            }
+          }
+        },
+        timestamp := 0,
+        viewVersion := 0
+      },
+      requestedMaxReferencesPerNode := 10000,
+      nodesToBrowse := {
+        realArray := {
+          arrayLength := 1,
+          arrayValues := {
+            {
+              nodeId := {
+                mask := 0,
+                namespaceUriBit := 0,
+                serverIndexBit := 0,
+                reservedBit1 := 0,
+                reservedBit2 := 0,
+                IdType := {
+                  twoByte := {
+                    nodeValue := 84
+                  }
+                }
+              },
+              browseDirection := BOTH_2,
+              referenceTypeId := {
+                mask := 0,
+                namespaceUriBit := 0,
+                serverIndexBit := 0,
+                reservedBit1 := 0,
+                reservedBit2 := 0,
+                IdType := {
+                  twoByte := {
+                    nodeValue := 0
+                  }
+                }
+              },
+              includeSubtypes := 1,
+              nodeClassMask := 0,
+              resultMask := 63
+            }
+          }
+        }
+      }
+    }
+
+    var ServiceBody v_service := {
+      encodingByte := 1,
+      namespaceIndex := 0,
+      nodeValue := 0,
+      list := {
+        BrowseRequest := v_browseReq
+      }
+    }
+
+    var octetstring v_encodedBody := enc_ServiceBody(v_service);
+    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));
+
+    return enc_MessageChunk (v_msg);
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                     ReadRequest                         //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetReadRequest() return octetstring {
+    var MessageHeader v_header := valueof(tr_HeaderService);
+
+    var UInt32 v_securityChannelId := 1;
+    var UInt32 v_securityTokenId := 1
+    var SequenceHeader v_sequenceHeader := {
+      SequenceNumber := 6,
+      RequestId := 6
+    }
+
+    var ReadRequest v_readReq := {
+      requestHeader := {
+        authenticationToken := {
+          mask := 5,
+          namespaceUriBit := 0,
+          serverIndexBit := 0,
+          reservedBit1 := 0,
+          reservedBit2 := 0,
+          IdType := {
+            byteString := {
+              nameSpace := 0,
+              nodeValue := valueof(tr_ByteString( { 213, 222, 175, 58, 50, 191, 56, 110, 161, 40, 190, 206, 46, 98, 162, 70 } ))
+            }
+          }
+        },
+        timestamp := 131556452505980000,
+        requestHandle := 7,
+        returnDiagnostics := 0,
+        auditEntryId := {
+          realString := {
+            stringLength := 0,
+            stringValue := ""
+          }
+        },
+        timeoutHint := 0,
+        additionalHeader := {
+          typeId := {
+            node := {
+              mask := 0,
+              namespaceUriBit := 0,
+              serverIndexBit := 0,
+              reservedBit1 := 0,
+              reservedBit2 := 0,
+              IdType := {
+                twoByte := {
+                  nodeValue := 0
+                }
+              }
+            },
+            namespaceUri := omit,
+            serverIndex := omit
+          },
+          Value := 0
+        }
+      },
+      maxAge := 0.0,
+      timestampsToReturn := BOTH_2,
+      nodesToRead := {
+        realArray := {
+          arrayLength := 1,
+          arrayValues := {
+            {
+              nodeId := {
+                mask := 3,
+                namespaceUriBit := 0,
+                serverIndexBit := 0,
+                reservedBit1 := 0,
+                reservedBit2 := 0,
+                IdType := {
+                  string := {
+                    nameSpace := 1,
+                    nodeValue :=  valueof (tr_String("free_memory"))
+                  }
+                }
+              },
+              attributeId := 13,
+              indexRange := valueof(tr_StringNull),
+              dataEncoding := {
+                namespaceIndex := 0,
+                name :=  valueof(tr_StringNull)
+              }
+            }
+          }
+        }
+      }
+    }
+
+    var ServiceBody v_service := {
+      encodingByte := 1,
+      namespaceIndex := 0,
+      nodeValue := 0,
+      list := {
+        ReadRequest := v_readReq
+      }
+    }
+
+    var octetstring v_encodedBody := enc_ServiceBody(v_service);
+    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));
+
+    return enc_MessageChunk (v_msg);
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //               CreateSubscriptionRequest                 //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetCreateSubscRequest() return octetstring {
+    var MessageHeader v_header := valueof(tr_HeaderService);
+
+    var UInt32 v_securityChannelId := 1;
+    var UInt32 v_securityTokenId := 1
+    var SequenceHeader v_sequenceHeader := {
+      SequenceNumber := 6,
+      RequestId := 6
+    }
+
+    var CreateSubscriptionRequest v_createSubsReq := {
+      requestHeader := {
+        authenticationToken := {
+          mask := 5,
+          namespaceUriBit := 0,
+          serverIndexBit := 0,
+          reservedBit1 := 0,
+          reservedBit2 := 0,
+          IdType := {
+            byteString := {
+              nameSpace := 0,
+              nodeValue := {
+                realByteString := {
+                  lengthValue := 16,
+                  byteStringValue := {
+                    213,
+                    222,
+                    175,
+                    58,
+                    50,
+                    191,
+                    56,
+                    110,
+                    161,
+                    40,
+                    190,
+                    206,
+                    46,
+                    98,
+                    162,
+                    70
+                  }
+                }
+              }
+            }
+          }
+        },
+        timestamp := 131556452506070000,
+        requestHandle := 8,
+        returnDiagnostics := 0,
+        auditEntryId := {
+          realString := {
+            stringLength := 0,
+            stringValue := ""
+          }
+        },
+        timeoutHint := 0,
+        additionalHeader := {
+          typeId := {
+            node := {
+              mask := 0,
+              namespaceUriBit := 0,
+              serverIndexBit := 0,
+              reservedBit1 := 0,
+              reservedBit2 := 0,
+              IdType := {
+                twoByte := {
+                  nodeValue := 0
+                }
+              }
+            },
+            namespaceUri := omit,
+            serverIndex := omit
+          },
+          Value := 0
+        }
+      },
+      requestedPublishingInterval := 100.0,
+      requestedLifetimeCount := 10,
+      requestedMaxKeepAliveCount := 2,
+      maxNotificationsPerPublish := 10,
+      publishingEnabled := 1,
+      priorityInt32 := 10
+    }
+
+    var ServiceBody v_service := {
+      encodingByte := 1,
+      namespaceIndex := 0,
+      nodeValue := 0,
+      list := {
+        CreateSubscriptionRequest := v_createSubsReq
+      }
+    }
+
+    var octetstring v_encodedBody := enc_ServiceBody(v_service);
+    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));
+
+    return enc_MessageChunk (v_msg);
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                   ServiceResponse                       //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetServiceResponse() return template MessageChunk {
+
+    template MessageChunk responseChunk modifies tr_baseResponseMessage := {
+      header := {
+        messageType := ServicesMsgType,
+        chunkType := FinalChunk,
+        messageSize := ?
+      }
+    }
+
+    return responseChunk;
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                   CloseSessionRequest                   //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetCloseSessionRequest() return octetstring {
+    var MessageHeader v_header := valueof(tr_HeaderService);
+
+    var UInt32 v_securityChannelId := 1;
+    var UInt32 v_securityTokenId := 1
+    var SequenceHeader v_sequenceHeader := {
+      SequenceNumber := 21,
+      RequestId := 21
+    }
+
+    var CloseSessionRequest v_closeSessionReq := {
+      requestHeader := {
+        authenticationToken := {
+          mask := 5,
+          namespaceUriBit := 0,
+          serverIndexBit := 0,
+          reservedBit1 := 0,
+          reservedBit2 := 0,
+          IdType := {
+            byteString := {
+              nameSpace := 0,
+              nodeValue := {
+                realByteString := {
+                  lengthValue := 16,
+                  byteStringValue := {
+                    213,
+                    222,
+                    175,
+                    58,
+                    50,
+                    191,
+                    56,
+                    110,
+                    161,
+                    40,
+                    190,
+                    206,
+                    46,
+                    98,
+                    162,
+                    70
+                  }
+                }
+              }
+            }
+          }
+        },
+        timestamp := 131556452556620000,
+        requestHandle := 20,
+        returnDiagnostics := 0,
+        auditEntryId := {
+          realString := {
+            stringLength := 0,
+            stringValue := ""
+          }
+        },
+        timeoutHint := 0,
+        additionalHeader := {
+          typeId := {
+            node := {
+              mask := 0,
+              namespaceUriBit := 0,
+              serverIndexBit := 0,
+              reservedBit1 := 0,
+              reservedBit2 := 0,
+              IdType := {
+                twoByte := {
+                  nodeValue := 0
+                }
+              }
+            },
+            namespaceUri := omit,
+            serverIndex := omit
+          },
+          Value := 0
+        }
+      },
+      deleteSubscriptions := 1
+    }
+
+    var ServiceBody v_service := {
+      encodingByte := 1,
+      namespaceIndex := 0,
+      nodeValue := 0,
+      list := {
+        CloseSessionRequest := v_closeSessionReq
+      }
+    }
+
+    var octetstring v_encodedBody := enc_ServiceBody(v_service);
+    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));
+
+    return enc_MessageChunk(v_msg);
+  }
+
+  /////////////////////////////////////////////////////////////
+  //                                                         //
+  //                CloseSecureChannelRequest                //
+  //                                                         //
+  /////////////////////////////////////////////////////////////
+
+  function f_GetCloseSecureChannelRequest() return octetstring {
+    var MessageHeader v_header := valueof(tr_HeaderCloseSecureChannel);
+
+    var UInt32 v_securityChannelId := 1;
+    var UInt32 v_securityTokenId := 1
+    var SequenceHeader v_sequenceHeader := {
+      SequenceNumber := 21,
+      RequestId := 21
+    }
+
+    var CloseSecureChannelRequest v_closeSecReq := {
+      requestHeader := reqHeader
+    }
+
+    var ServiceBody v_service := {
+      encodingByte := 1,
+      namespaceIndex := 0,
+      nodeValue := 0,
+      list := {
+        CloseSecureChannelRequest := v_closeSecReq
+      }
+    }
+
+    var octetstring v_encodedBody := enc_ServiceBody(v_service);
+    var MessageChunk v_msg := valueof(tr_MessageCloseSecureChannel(v_header, v_securityChannelId, v_securityTokenId, v_sequenceHeader, v_encodedBody));
+
+    return enc_MessageChunk(v_msg);
+  }
+}
diff --git a/test/OpcUa_Test_Binary.ttcn b/test/OpcUa_Test_Binary.ttcn
old mode 100644
new mode 100755
diff --git a/test/OpcUa_Test_JSON.ttcn b/test/OpcUa_Test_JSON_Non_Reversible.ttcn
similarity index 97%
copy from test/OpcUa_Test_JSON.ttcn
copy to test/OpcUa_Test_JSON_Non_Reversible.ttcn
index 1ad8386..b7efd6c 100644
--- a/test/OpcUa_Test_JSON.ttcn
+++ b/test/OpcUa_Test_JSON_Non_Reversible.ttcn
@@ -13,11 +13,11 @@
 //  Prodnr:       CNL113861
 /////////////////////////////////////////////////////////////////////////////////////
 
-module OpcUa_Test_JSON {
+module OpcUa_Test_JSON_Non_Reversible {
 
-  import from OpcUa_Types_JSON_Reversible all;
-  import from OpcUa_Functions_JSON all;
-  import from OpcUa_Templates_JSON_Reversible all;
+  import from OpcUa_Types_JSON_Non_Reversible all;
+  import from OpcUa_Functions_JSON_Non_Reversible all;
+  import from OpcUa_Templates_JSON_Non_Reversible all;
 
   type component MyComp {}
 
@@ -663,7 +663,7 @@
           auditEntryId := "tmp",
           timeoutHint := 0,
           additionalHeader := {
-            typeId := valueof(tr_ExpandedNodeId_GUID("AS", 0, 0)),
+            typeId := valueof(tr_ExpandedNodeId_GUID("AS", tr_Namespace_1, "namespace")),
             Value := 1
           }
         },
@@ -701,19 +701,22 @@
         responseHeader := {
           timestamp := "2018.04.13",
           requestHandle := 3,
-          serviceResult := 1,
+          serviceResult := omit,
           serviceDiagnostics := {
             SymbolicId := 1,
             NamespaceUri := 0,
             Locale := 1,
             LocalizedText := 22,
             AdditionalInfo := "Hello",
-            InnerStatusCode := 1,
+            InnerStatusCode := {
+              Code := 1,
+              Symbol := "Error"
+            },
             InnerDiagnosticInfo := omit
           },
           stringTable := {"Hello", "Bye"},
           additionalHeader := {
-            typeId := valueof(tr_ExpandedNodeId_GUID("AS", 0, 0)),
+            typeId := valueof(tr_ExpandedNodeId_GUID("AS", tr_Namespace("namespace"), omit)),
             Value := 1
           }
         },
diff --git a/test/OpcUa_Test_JSON.ttcn b/test/OpcUa_Test_JSON_Reversible.ttcn
similarity index 99%
rename from test/OpcUa_Test_JSON.ttcn
rename to test/OpcUa_Test_JSON_Reversible.ttcn
index 1ad8386..23958a3 100644
--- a/test/OpcUa_Test_JSON.ttcn
+++ b/test/OpcUa_Test_JSON_Reversible.ttcn
@@ -13,10 +13,10 @@
 //  Prodnr:       CNL113861
 /////////////////////////////////////////////////////////////////////////////////////
 
-module OpcUa_Test_JSON {
+module OpcUa_Test_JSON_Reversible {
 
   import from OpcUa_Types_JSON_Reversible all;
-  import from OpcUa_Functions_JSON all;
+  import from OpcUa_Functions_JSON_Reversible all;
   import from OpcUa_Templates_JSON_Reversible all;
 
   type component MyComp {}
diff --git a/test/server.js b/test/server.js
index d586142..dd37cd0 100644
--- a/test/server.js
+++ b/test/server.js
@@ -1,127 +1,126 @@
-/////////////////////////////////////////////////////////////////////////////////////

-// Copyright (c) 2017-2018  Ericsson AB

-// All rights reserved. This program and the accompanying materials

-// are made available under the terms of the Eclipse Public License v1.0

-// which accompanies this distribution, and is available at

-// http://www.eclipse.org/legal/epl-v10.html

-/////////////////////////////////////////////////////////////////////////////////////

-// Contributors:

-// Akos Makovics

-//

-//  File:         server.js

-//  Rev:          <RnXnn>

-//  Prodnr:       CNL113861

-/////////////////////////////////////////////////////////////////////////////////////

-

-/*global require,setInterval,console */

-var opcua = require("node-opcua");

-

-

-// Let's create an instance of OPCUAServer

-var server = new opcua.OPCUAServer(

-    {

-        port: 4334, // the port of the listening socket of the server

-        resourcePath: "UA/MyLittleServer", // this path will be added to the endpoint resource name

-        buildInfo :

-        {

-            productName: "MySampleServer1",

-            buildNumber: "7658",

-            buildDate: new Date(2014,5,2)

-        }

-    });

-

-function post_initialize() {

-

-    console.log("initialized");

-

-    function construct_my_address_space(server) {

-

-        var addressSpace = server.engine.addressSpace;

-

-        // declare a new object

-        var device = addressSpace.addObject({

-            organizedBy: addressSpace.rootFolder.objects,

-            browseName: "MyDevice"

-        });

-

-        

-        // add some variables

-        // add a variable named MyVariable1 to the newly created folder "MyDevice"

-        var variable1 = 1;

-

-        // emulate variable1 changing every 500 ms

-        setInterval(function(){  variable1+=1; }, 500);

-

-        addressSpace.addVariable({

-            componentOf: device,

-            browseName: "MyVariable1",

-            dataType: "Double",

-            value: {

-                get: function () {

-                    return new opcua.Variant({dataType: opcua.DataType.Double, value: variable1 });

-                }

-            }

-        });

-

-        /*

-        // add a variable named MyVariable2 to the newly created folder "MyDevice"

-        var variable2 = 10.0;

-

-        server.engine.addressSpace.addVariable({

-

-            componentOf: device,

-

-            nodeId: "ns=1;b=1020FFAA", // some opaque NodeId in namespace 4

-

-            browseName: "MyVariable2",

-

-            dataType: "Double",

-

-            value: {

-                get: function () {

-                    return new opcua.Variant({dataType: opcua.DataType.Double, value: variable2 });

-                },

-                set: function (variant) {

-                    variable2 = parseFloat(variant.value);

-                    return opcua.StatusCodes.Good;

-                }

-            }

-        });

-        */

-

-        var os = require("os");

-

-        function available_memory() {

-            return os.freemem() / os.totalmem() * 100.0;

-        }

-

-        server.engine.addressSpace.addVariable({

-

-            componentOf: device,

-            nodeId: "ns=1;s=free_memory", // a string nodeID

-            browseName: "FreeMemory",

-            dataType: "Double",

-            value: {

-                get: () => {

-                    return new opcua.Variant(

-                        {

-                            dataType:   opcua.DataType.Double,

-                            value:      available_memory()

-                        });

-                    }

-            }

-        });

-    }

-

-    construct_my_address_space(server);

-

-    server.start(function() {

-        console.log("Server is now listening ... ( press CTRL+C to stop)");

-        console.log("port ", server.endpoints[0].port);

-        var endpointUrl = server.endpoints[0].endpointDescriptions()[0].endpointUrl;

-        console.log(" the primary server endpoint url is ", endpointUrl );

-    });

-}

-

-server.initialize(post_initialize);

-

+/////////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2017-2018  Ericsson AB
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+/////////////////////////////////////////////////////////////////////////////////////
+// Contributors:
+// Akos Makovics
+//
+//  File:         server.js
+//  Rev:          <RnXnn>
+//  Prodnr:       CNL113861
+/////////////////////////////////////////////////////////////////////////////////////
+
+/*global require,setInterval,console */
+var opcua = require("node-opcua");
+
+
+// Let's create an instance of OPCUAServer
+var server = new opcua.OPCUAServer(
+    {
+        port: 4334, // the port of the listening socket of the server
+        resourcePath: "UA/MyLittleServer", // this path will be added to the endpoint resource name
+        buildInfo :
+        {
+            productName: "MySampleServer1",
+            buildNumber: "7658",
+            buildDate: new Date(2014,5,2)
+        }
+    });
+
+function post_initialize() {
+
+    console.log("initialized");
+
+    function construct_my_address_space(server) {
+
+        var addressSpace = server.engine.addressSpace;
+
+        // declare a new object
+        var device = addressSpace.addObject({
+            organizedBy: addressSpace.rootFolder.objects,
+            browseName: "MyDevice"
+        });
+
+        // add some variables
+        // add a variable named MyVariable1 to the newly created folder "MyDevice"
+        var variable1 = 1;
+
+        // emulate variable1 changing every 500 ms
+        setInterval(function(){  variable1+=1; }, 500);
+
+        addressSpace.addVariable({
+            componentOf: device,
+            browseName: "MyVariable1",
+            dataType: "Double",
+            value: {
+                get: function () {
+                    return new opcua.Variant({dataType: opcua.DataType.Double, value: variable1 });
+                }
+            }
+        });
+
+        /*
+        // add a variable named MyVariable2 to the newly created folder "MyDevice"
+        var variable2 = 10.0;
+
+        server.engine.addressSpace.addVariable({
+
+            componentOf: device,
+
+            nodeId: "ns=1;b=1020FFAA", // some opaque NodeId in namespace 4
+
+            browseName: "MyVariable2",
+
+            dataType: "Double",
+
+            value: {
+                get: function () {
+                    return new opcua.Variant({dataType: opcua.DataType.Double, value: variable2 });
+                },
+                set: function (variant) {
+                    variable2 = parseFloat(variant.value);
+                    return opcua.StatusCodes.Good;
+                }
+            }
+        });
+        */
+
+        var os = require("os");
+
+        function available_memory() {
+            return os.freemem() / os.totalmem() * 100.0;
+        }
+
+        server.engine.addressSpace.addVariable({
+
+            componentOf: device,
+            nodeId: "ns=1;s=free_memory", // a string nodeID
+            browseName: "FreeMemory",
+            dataType: "Double",
+            value: {
+                get: () => {
+                    return new opcua.Variant(
+                        {
+                            dataType:   opcua.DataType.Double,
+                            value:      available_memory()
+                        });
+                    }
+            }
+        });
+    }
+
+    construct_my_address_space(server);
+
+    server.start(function() {
+        console.log("Server is now listening ... ( press CTRL+C to stop)");
+        console.log("port ", server.endpoints[0].port);
+        var endpointUrl = server.endpoints[0].endpointDescriptions()[0].endpointUrl;
+        console.log(" the primary server endpoint url is ", endpointUrl );
+    });
+}
+
+server.initialize(post_initialize);
+