Cisco Cisco TelePresence Management Suite (TMS) Version 15 Developer's Guide

Page of 68
Remote setup API examples
The code snippet below demonstrates how to authenticate with the remote setup API.
public
 
void
 InitRemoteSetupService()
 
{
 
    
// Specify username and password to authenticate to service.
 
    
// (Can also be done in web.config) 
 
    NetworkCredential credentials = 
new
 NetworkCredential(
"username"
"password"
"domain"
);
 
 
    remoteSetupService = 
new
 RemoteSetupService { Credentials = credentials };            
 
    
if
 (remoteSetupService.ExternalAPIVersionSoapHeaderValue == 
null
)
 
    {
 
        remoteSetupService.ExternalAPIVersionSoapHeaderValue = 
new
 RemoteSetupServiceWS.ExternalAPIVers
ionSoapHeader();
 
    }
 
    remoteSetupService.ExternalAPIVersionSoapHeaderValue.ClientVersionIn = 11;
 
}
The code snippet below demonstrates how to loop through all systems in Cisco TMS, and display 
information about each system.
public
 
void
 DisplaySystemInformation()
 
{
 
    InitRemoteSetupService();
 
    
// Get all systems from TMS 
 
    RemoteSetupServiceWS.TMSSystem[] tmsSystems = remoteSetupService.GetSystems(); 
 
    
// Loop through the systems and output information about each system 
foreach
 (RemoteSetupServiceWS.
TMSSystem tmsSystem 
in
 tmsSystems)
 
    {
 
        Console.Out.WriteLine(
"SystemId: "
 + tmsSystem + 
" System Name:"
 + tmsSystem.SystemName);
 
    }            
 
}
Cisco TMSBA Programming Reference Guide
Page 58 of 68
Code examples