[
https://issues.apache.org/jira/browse/PLC4X-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17537253#comment-17537253
]
Ben Hutcheson commented on PLC4X-342:
-------------------------------------
So it looks like that monitoredItemId in the response of the
CreateMonitoredItemsResponse doesn't necessarily need to match the client
handle within the CreateMonitoredItemsRequest. Instead, the size and order of
the list within the response should match that was requested. The
monitoreditemid should be used when we need to modify the the monitored item
(which I don't think we do).
https://reference.opcfoundation.org/v104/Core/docs/Part4/5.12.2/
https://reference.opcfoundation.org/v104/Core/docs/Part4/7.16/
!image-2022-05-16-05-02-37-149.png!
!Monitored Item Server Side ID.png!
> OPC UA silently fails to handle subscription response
> -----------------------------------------------------
>
> Key: PLC4X-342
> URL: https://issues.apache.org/jira/browse/PLC4X-342
> Project: Apache PLC4X
> Issue Type: Bug
> Components: Driver-OPC-UA
> Affects Versions: 0.9.1
> Reporter: Ćukasz Dywicki
> Assignee: Ben Hutcheson
> Priority: Major
> Attachments: Monitored Item Server Side ID.png,
> image-2022-05-16-05-02-37-149.png, opcua_monitored_item_wrong_index..pcapng
>
>
> While test of OPC UA simulator coming from freeopcua I found out that our
> client doesn't work with it. Maybe it is an issue of how they encode payload,
> maybe it is inconsistency in the spec, not sure - the end result is that
> actual response processing error gets swallowed and driver hangs.
> Guilty code is in {{OpcuaSubscriptionHandle}}:
> {code:java}
> for (MonitoredItemCreateResult result :
> responseMessage.getResults().toArray(new MonitoredItemCreateResult[0])) {
> if (OpcuaStatusCode.enumForValue(result.getStatusCode().getStatusCode())
> != OpcuaStatusCode.Good) {
> LOGGER.error("Invalid Field {}, subscription created without this
> field", fieldNames.get((int) result.getMonitoredItemId()));
> } else {
> LOGGER.debug("Field {} was added to the subscription",
> fieldNames.get((int) result.getMonitoredItemId() - 1)); // !monitored item id
> might be inconsistent!
> }
> }
> {code}
> Copy of traffic causing issue in attachment.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)