Geo SCADA Expert

You can connect to ClearSCADA using SOAP via the web ports on the server. This example shows how to access database items and modify the item properties using the SOAP interface from Visual Studio and C#.

First create a new project, select C# among lanuages and the Windows application type. In our example we used SoapClnt as a project name.

Then add web reference to the project, this should be

http://SERVER:port/webservices/scx

Use the same SERVER name and port number that is used for WebX access.

Add a name to the reference, in our example we used WebRefSCX. (There is another reference available which could be used in similar way.)

Then create a connection to database by creating a new class of SCXService:

...
SoapClnt.WebRefSCX.SCXService MySoap;
MySoap = new SoapClnt.WebRefSCX.SCXService ();
...

The newly created class is ready to connect to the same server you used for the reference, if you want to connect to another server, you need to overwrite the URL property.

MySoap.Url = "http://" + ServerName.Text + "/webservices/scx";

That is all you need to acces data using ExecuteQuery service.

obj = new object[0];
bool limit;
object[][] retobj;
retobj = MySoap.ExecuteQuery("Select FullName from CDBPoint", obj, out limit);
for (int i = 0; i < retobj.Length; i++)
PointList.Items.Add(retobj[i][0].ToString());

Then you can use ExecuteMethod service to be executed on any database object. In our sample we use CurrentValue method to set a new value to internal analog point.

obj = new object[1];
object retobj;
obj.SetValue(float.Parse(PntValue.Text), 0);
retobj=MySoap.ExecuteMethod(PointList.SelectedItem.ToString(), "CurrentValue", obj);

You can download complete working sample here.

  1. Sep 22, 2011

    Anonymous says:

    How can i provide username and password to clearSCADA server through SOAP. I ne...

    How can i provide username and password to clearSCADA server through SOAP.

    I need to give full permision to execute method like 'AcceptWithComment' using SOAP ExecuteMethod

  2. Jan 05, 2012

    Anonymous says:

    I have same problem with send message to user.

    I have same problem with send message to user.