How to Use SOA in a Simple Method?
- Last UpdatedJun 10, 2024
- 5 minute read
This example illustrates the use of SOA in a simple method in a .NET framework assembly
PROCEDURE
NAMESPACE USED
System
System.Collections.Generic
System.Text
To create a New Project
-
Launch Microsoft Visual Studio. The Visual Studio Start Page opens.
-
On the File menu, point to New, and then select Project. The New Project dialog box appears.
-
In the right pane, select Class Library.
-
Create your .net Class Library. For example, in the Name box, type MySkeltaTest.
-
Set the path to save the project. For example, in the Location drop-down, set the location as M:\Work.
-
In the Solution Name box, type the directory name. By default, it displays the directory name as the specified project name.
-
Click OK. The MySkeltaTest project gets created in the path M:\Work.
Sample code to create the class
using System;
using System.Collections.Generic;
using System.Text;
namespace MySkeltaTest
{
public class MyTest
{
private int id;
public MyTest()
{
}
public MyTest(int inde)
{
id = inde;
}
public string GetName()
{
return "Welcome to Skelta SOA";
}
public string GetNextName()
{
return "Wonderful feature";
}
public string Unique_Name(int iID)
{
if (iID == 1return "Use WEB Service";
}
else if (iID == 2)
{
return "Access SQL Server data";
}
else if (iID == 1)
{
return "Access COM object";
}
else
return "What not";
}
}
}
-
Build the created project. The dll gets created in M:\Work\MySkeltaTest\MySkeltaTest\bin\Debug folder.
Adding this folder in the SOA Folder option:
-
On the Windows Start menu, point to All Programs, point to Wonderware, point to AVEVA Work Tasks, and then click Central Configuration. The Central Configuration page appears.
-
Click Repository List. The Repository List page appears.
-
In the Site Path column, click the desired link to log on to the desired repository. You would be redirected to the Enterprise Portal.
-
Select the required Authentication Provider.
-
Log on to the Enterprise Console.
-
In the Enterprise Console, click the Menu button, click Settings, and then click SOA Folder. The Folder List page appears.
-
On the action bar, click New. The Folder Configuration- New wizard appears.
-
In the Title box, type a name for the folder, and in the Description box, type a description for the folder.
-
In the Physical Path box, type the physical path. For example, M:\Work\MySkeltaTest\MySkeltaTest\bin\Debug.
-
Click View Assemblies. All the assemblies available in the given path will be listed in the List of Assemblies section.
-
Click Save. The SOA folder is created.
Adding Assembly into SOA Assembly Repository
-
In the Enterprise Console, click the Menu button, click Tools, and then click SOA Assembly. The Assembly List page appears.
-
On the action bar, click New, and then click From Assembly Folder to select an assembly from a registered folder. The Select an Assembly page appears.
-
Select the assembly. The assembly must be a .NET Framework assembly.
After you select an assembly, you can browse through the namespaces, classes, and methods of the assembly. You can also provide an alias for the selected methods.

-
Click Next. The Object Setup page appears.
-
Select methods to provide an alias.

Note: By default, all the classes and methods are checked. If you do not want to use any particular class or method, then uncheck the class or method. However, the unchecked class will not be displayed in the Start Activity of the SOA Object Instance property. The unchecked class will be displayed in the Expression Editor of any activity, but the data will not be available.
-
Click Finish & Publish.
-
In the Enterprise Console, click the Menu button, and then click Workflows. The Workflows page appears.
-
Design a workflow. The Process Designer appears.
-
In the Activity Properties of the Start activity, select SOA Object Instances property to instantiate a class for the specific purpose. The SOA Object Instance page appears.
-
Select the appropriate constructor for the specified class.
-
Click Save to save the object instance.
-
Design a simple workflow that has two activities, Update Variable Activity and Logger Activity. You need the Update activity to update a variable, and the Logger activity to display a value.

-
In the Activity Properties of the Start activity, click the Variable property to create a variable of type string. For example, you can name the variable as stMySOAResult.

-
Click Update.
-
In the Activity Properties of the Update Variable activity, select Set Variable property. The Update Variable page appears.
-
In the Condition column, select the variable.

-
In the Value column, select Build Expression.

-
Use the instance method. For example, My Test.

-
In the Activity Properties of the Logger activity, select the LogMessage property. The LogMessage page appears.

-
Type the log message to be displayed.
-
Click Update. The result appears in the Logger Console.