This functionality is provided by the automated testing bridge that allows obtaining TestComplete test results to the QAComplete Automation screen. Starting from the release 9.9.0, this functionality is obsolete and is supported only for backward compatibility. |
Gets a host by its ID and updates its properties with specified values. All unspecified properties are cleared.
Requirements
The user must belong to a security group that has the Update privilege for Automation Hosts.
Parameters
The operation uses the following parameters:
AuthenticationData : object, required
An AuthenticationData
object containing the login information and the ID of the project whose host you want to update.
An AutomationHost object that contains the updated host data.
Result
None.
Example
Sample Code
C#
string login = "[email protected]";
string password = "p@ssword";
ServiceSoapClient service = new ServiceSoapClient();
// Prepare AuthenticationData
LoginInfo loginInfo = service.GetLoginInfo("", login, password);
AuthenticationData authData = new AuthenticationData();
authData.AppCode = loginInfo.AppCode;
authData.UserId = loginInfo.UserId;
authData.PassCode = password;
authData.DeptId = loginInfo.DeptId;
authData.ProjId = loginInfo.ProjId;
// Prepare the AutomationHost object
AutomationHost host = new AutomationHost();
// Get the existing host to update
int hostId = 1;
host = service.AutomationHosts_Load(authData, hostId);
// Specify new values for the host properties
host.HostName = "Test-WinXPx86" ;
host.Description = "Test host with Windows XP x86";
// Update the host
service.AutomationHosts_Update(authData, host);
Java
String login = "[email protected]";
String password = "p@ssword";
ServiceSoap service = new Service().getServiceSoap12();
// Prepare AuthenticationData
LoginInfo loginInfo = service.getLoginInfo("", login, password);
AuthenticationData authData = new AuthenticationData();
authData.setAppCode(loginInfo.getAppCode());
authData.setUserId(loginInfo.getUserId());
authData.setPassCode(password);
authData.setDeptId(loginInfo.getDeptId());
authData.setProjId(loginInfo.getProjId());
// Prepare the AutomationHost object
AutomationHost host = new AutomationHost();
// Get the existing host to update
int hostId = 1;
host = service.automationHostsLoad(authData, hostId);
// Specify new values for host properties
host.setHostName("Test-WinXPx86");
host.setDescription("Test host with Windows XP x86");
// Update the host
service.automationHostsUpdate(authData, host);
Sample Request XML
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 691 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/AutomationHosts_Update"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AutomationHosts_Update xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
</AuthenticationData>
<AutomationHost>
<AutomaticHostId>1</AutomaticHostId>
<HostName>Test-WinXPx86</HostName>
<Description>Test host with Windows XP x86</Description>
<CreateUserId>24661</CreateUserId>
<UpdateUserId>24661</UpdateUserId>
<DateCreated>2014-07-20T09:26:39</DateCreated>
<DateUpdated>2014-08-12T10:17:52</DateUpdated>
</AutomationHost>
</AutomationHosts_Update>
</soap:Body>
</soap:Envelope>
SOAP 1.2
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 699 {Insert an appropriate value here}
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<AutomationHosts_Update xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
</AuthenticationData>
<AutomationHost>
<AutomaticHostId>1</AutomaticHostId>
<HostName>Test-WinXPx86</HostName>
<Description>Test host with Windows XP x86</Description>
<CreateUserId>24661</CreateUserId>
<UpdateUserId>24661</UpdateUserId>
<DateCreated>2014-07-20T09:26:39</DateCreated>
<DateUpdated>2014-08-12T10:17:52</DateUpdated>
</AutomationHost>
</AutomationHosts_Update>
</soap12:Body>
</soap12:Envelope>
Sample Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 316 {The server returns an appropriate value here}
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AutomationHosts_UpdateResponse xmlns="http://www.pragmaticsw.com/" />
</soap:Body>
</soap:Envelope>
SOAP 1.2
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 326 {The server returns an appropriate value here}
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<AutomationHosts_UpdateResponse xmlns="http://www.pragmaticsw.com/" />
</soap12:Body>
</soap12:Envelope>
See Also
Automation Hosts Operations
AutomationHosts_Add
AutomationHosts_Delete
AutomationHosts_Load
AutomationHosts_LoadByCriteria
Automated Testing Bridge Operations
SOAP API Reference