Echelon i.LON SmartServer 2.0 User Manual
Page 379

i.LON SmartServer 2.0 Programmer’s Reference
21-27
iLON_SmartServer_System.
messageProperties_system
systemInfo =
new
iLON_SmartServer_System.
messageProperties_system
();
string
staticData =
"<iLONSystemService><UCPTsystemInfoType>SI_STATIC</UCPTsystemInfoType></iLONSystemService>"
;
string
staticResult = SmartServer.SystemService_Read_Info(
ref
systemInfo, staticData);
Console
.Out.WriteLine(staticResult);
Console
.Out.WriteLine(
"\r\n Changing the SmartServer's System Time\r\n"
);
iLON_SmartServer_System.
messageProperties_system
revisedTime =
new
iLON_SmartServer_System.
messageProperties_system
();
string
revisedTimeData =
"<iLONSystemService><TIME>SI_TIME<UCPTsystemTime>2008-07-05T10:20:00</UCPTsystemTime></TI
ME></iLONSystemService>"
;
string
revisedTimeResult = SmartServer.SystemService_Write_Info(
ref
revisedTime,
revisedTimeData);
Console
.Out.WriteLine(revisedTimeResult);
Console
.Out.WriteLine(
"\r\nTake a 10-second break to see if time updates properly \r\n"
);
Thread
.Sleep(10000);
iLON_SmartServer_System.
messageProperties_system
newTime =
new
iLON_SmartServer_System.
messageProperties_system
();
string
newTimeData =
"<iLONSystemService><UCPTsystemInfoType>SI_TIME</UCPTsystemInfoType></iLONSystemService>"
;
string
newTimeResult = SmartServer.SystemService_Read_Info(
ref
newTime, newTimeData);
Console
.Out.WriteLine(newTimeResult);
Console
.In.ReadLine();
}
finally
{
iLON_SoapCalls
.CloseBindingToSmartServer();
}
}
}
}
Web Service Instantiation in iLON_SoapCalls Class for NET 3.5 Framework
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.ServiceModel;
namespace
SystemServiceExample
{
class
iLON_SoapCalls
{
// your SmartServers's IpAddress
public
static
string
_iLonEndpointIpAddress =
"your SmartServer's IP address"
;
// your SmartServer’s web service reference
static
public
iLON_SmartServer_System.
iLON100portTypeClient
_iLON =
null
;
///
<summary>
///
Instantiates the i.LON web service for
///
.NET 3.5
///
</summary>
static
public
void
BindClientToSmartServer()