Two NamespaceIndexes in .XML file

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
prudhviraj1991
Full Member
Full Member
Posts: 7
Joined: 16 Dec 2018, 19:42

Two NamespaceIndexes in .XML file

Post by prudhviraj1991 »

Hallo Members,

I have a data model (.XML file) from Automation ML editor and I want to use your .NET SDK to implement the server part. Can I import the AutomationML editor data model (XML file) directly in your SDK (I mean in the C# code)or It is only compatible with the exported XML file from the UaModeler?

If it is compatible, then my Information model (.XML file) have two namespaces, does anyone guide me how to program this in C# (if there exists more than one namespaceIndexes) ?

My NamespaceUri's

Code: Select all

<NamespaceUris> 
<Uri>http://opcfoundation.org/UA/AML/</Uri> 
<Uri>http://www.xyz.de/DeviceModelling.aml</Uri> 
</NamespaceUris>
`
The tutorial 2 has only one namespace and the C# program also have one namespace as in the code below

Code: Select all

internal class Lesson2NodeManager : BaseNodeManager
    {
        public ushort InstanceNamespaceIndex { get; set; }
        public ushort TypeNamespaceIndex { get; set; }

        public override void Startup()
        {
            try
            {
                base.Startup();

                Console.WriteLine("Starting Lesson2NodeManager.");

                InstanceNamespaceIndex = AddNamespaceUri("http://yourorganisation.com/lesson02/");
                TypeNamespaceIndex = AddNamespaceUri(yourorganisation.BA.Namespaces.BA);
        
                Console.WriteLine("Loading the Controller Model.");
                ImportUaNodeset(Assembly.GetEntryAssembly(), "buildingautomation.xml");
.............
Thank you in advance.

prudhviraj1991
Full Member
Full Member
Posts: 7
Joined: 16 Dec 2018, 19:42

Re: Two NamespaceIndexes in .XML file

Post by prudhviraj1991 »

Hallo,

I solved this issue by commenting out the namespaceUri and only importing the XML file and its dependencies.

Thank you,
Prudhvi

Post Reply