Login  •  Register


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 ...

Two NamespaceIndexes in .XML file

Postby prudhviraj1991 » 14 Feb 2019, 15:37

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
Newbie
Newbie
 
Posts: 7
Joined: 16 Dec 2018, 19:42

Re: Two NamespaceIndexes in .XML file

Postby prudhviraj1991 » 25 Feb 2019, 11:47

Hallo,

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

Thank you,
Prudhvi
prudhviraj1991
Newbie
Newbie
 
Posts: 7
Joined: 16 Dec 2018, 19:42


Return to .NET based OPC UA SDK

Who is online

Users browsing this forum: No registered users and 1 guest

cron