Skip to content

Commit

Permalink
Check if data encoding is registered with EncodingManager
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinherron committed Sep 15, 2022
1 parent 3239f40 commit 95bbbe1
Showing 1 changed file with 1 addition and 5 deletions.
Expand Up @@ -46,7 +46,6 @@
import org.eclipse.milo.opcua.stack.core.StatusCodes;
import org.eclipse.milo.opcua.stack.core.UaException;
import org.eclipse.milo.opcua.stack.core.UaSerializationException;
import org.eclipse.milo.opcua.stack.core.types.DataTypeEncoding;
import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
import org.eclipse.milo.opcua.stack.core.types.builtin.DiagnosticInfo;
import org.eclipse.milo.opcua.stack.core.types.builtin.ExtensionObject;
Expand Down Expand Up @@ -449,10 +448,7 @@ private BaseMonitoredItem<?> createMonitoredItem(
throw new UaException(StatusCodes.Bad_DataEncodingInvalid);
}

// TODO this should check with EncodingManager instead
if (!dataEncoding.equals(DataTypeEncoding.BINARY_ENCODING_NAME) &&
!dataEncoding.equals(DataTypeEncoding.XML_ENCODING_NAME)) {

if (!server.getEncodingManager().hasEncoding(dataEncoding)) {
throw new UaException(StatusCodes.Bad_DataEncodingUnsupported);
}
}
Expand Down

0 comments on commit 95bbbe1

Please sign in to comment.