Methods: Client send input argument DateTime instead of Date|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Methods: Client send input argument DateTime instead of Date
Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
1
04/09/2020 - 04:08
sp_Permalink sp_Print

A server provides a method with an input argument from data type Date.

The client requests a call service with this method and with data type DateTime instead of Date for the input argument.

The server response BadInvalidArgument.

IMHO the server do it right!? And so the client has a bug.

Is my assumption correct?

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
04/09/2020 - 05:33
sp_Permalink sp_Print

When a DataType is a sub-type of a non-Structure built-in type (in this case DateTime) the value is transferred on the wire as the base builtin type. The receiver cannot distinguish between values of the sub-type and values of the base-type and therefore has to accept values of the base-type.

That said, if specific semantics apply to the subtype in the documentation then the application may reject a value after checking those semantics but that check occurs in the application rather than the stack or SDK. In the case of Date, no specific semantics are defined so there is no reason for rejecting a valid DateTime value.

The Server should also return a specific error code for the problematic argument (i.e. BadTypeMismatch) in the InputArgumentResults array. It also may support diagnostics that give string explanations for the failure.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 23
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1445
Posts: 4889