问题描述
是否有将 ExtensionObject 转换为可以在 SpringBoot 中使用的 CustomClass(在 Camel - Milo 中)的示例?
routeBuilder.from(getUriFrom("ns=4;s=GV_PcHmi.tPcHmi.tPlcToPcHmiSta.atAlarm",1000))
.process((Exchange exchange) -> {
DataValue data = exchange.getIn().getBody(DataValue.class);
if( data.getStatusCode().isGood() )
{
ExtensionObject[] value = (ExtensionObject[]) data.getValue().getValue();
for( ExtensionObject x : xo )
{
CONVERSION ???
}
}
解决方法
您将在 ExtensionObject 上调用 decode()
。
要解码自定义数据类型,服务器必须公开定义所有自定义类型的 OPC UA 1.03 数据类型字典。