Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complex type system cannot create class when property is a enum. #1561

Closed
mregen opened this issue Oct 27, 2021 · 0 comments · Fixed by #1562
Closed

Complex type system cannot create class when property is a enum. #1561

mregen opened this issue Oct 27, 2021 · 0 comments · Fixed by #1562

Comments

@mregen
Copy link
Contributor

mregen commented Oct 27, 2021

Type of Issue

  • Bug

Describe the Issue
Complex type can not be decoded.

To Reproduce
Server has DataTypeDictionary:

<opc:TypeDictionary xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:tns="http://abc/UA/SampleNamespace" 
DefaultByteOrder="LittleEndian" 
xmlns:opc="http://opcfoundation.org/BinarySchema/" 
xmlns:ua="http://opcfoundation.org/UA/" 
TargetNamespace="http://abc/UA/SampleNamespace">
 <opc:Import Namespace="http://opcfoundation.org/UA/"/>
 <opc:StructuredType BaseType="ua:ExtensionObject" Name="DynamicStructureType">
  <opc:Field TypeName="opc:Bit" Name="Field2Specified"/>
  <opc:Field Length="31" TypeName="opc:Bit" Name="Reserved1"/>
  <opc:Field TypeName="opc:CharArray" Name="Field1"/>
  <opc:Field SwitchField="Field2Specified" TypeName="opc:CharArray" Name="Field2"/>
  <opc:Field TypeName="opc:Double" Name="Field3"/>
  <opc:Field TypeName="ua:Argument" Name="Field4"/>
  <opc:Field TypeName="opc:Int32" Name="NoOfField5"/>
  <opc:Field LengthField="NoOfField5" TypeName="opc:Int16" Name="Field5"/>
  <opc:Field TypeName="ua:ApplicationType" Name="Field6"/>
 </opc:StructuredType>
</opc:TypeDictionary>

Field6 is not properly mapped to a system type, so the complex type can not be created.
Fix: add special case to deal with supertype of 'enumeration' in namespace 0.

Expected behavior

Environment (please complete the following information):

  • OS: Windows 10
  • Development environment: [e.g. Visual Studio 2019 ]
  • Runtime: [.NET Core 3.1]
  • OPC Package Release Version [e.g. 1.4.368-preview]
  • Component: Opc.Ua.Core.Client.ComplexTypes]
  • Server: Java sample server
  • Client: complex types console client

Additional context
IOP Workshop 2021

mregen added a commit that referenced this issue Oct 29, 2021
-fixes for complex types:
  - a structure which contains an enum from namespace 0 can not be created. fixes #1561.
  - a structure with multidimensional array may lead to a endless loop in `ComplexTypeSystem.Load`
  - a malformed namespace Uri which contains a space character prevents creation of type system.
  - select endpoint doesn't pick the right scheme if the default endpoint must be picked
-prep for net472 or greater and net5.0 or greater build, only build #ifdef
opcfoundation-org pushed a commit that referenced this issue Nov 2, 2021
-fixes for complex types:
  - a structure which contains an enum from namespace 0 can not be created. fixes #1561.
  - a structure with multidimensional array may lead to a endless loop in `ComplexTypeSystem.Load`
  - a malformed namespace Uri which contains a space character prevents creation of type system.
  - select endpoint doesn't pick the right scheme if the default endpoint must be picked
-prep for net472 or greater and net5.0 or greater build, only build #ifdef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant