PerfLogs_Add Operation

Applies to QAComplete 14.4, last modified on June 20, 2024

Use the method to add a new performance log record to the Performance Log Manager in QAComplete.

Parameters

The operation uses the following parameters:

AuthenticationData  :  AuthenticationData, required

An AuthenticationData object containing the login information.

PerfLog  :  PerfLog, required

The PerfLog object that represents a performance log record you want to create.

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 PerfLog object
PerfLog log = new PerfLog();

log.Task = "Show Test Results";
log.BeginDateTime = DateTime.Now;
log.EndDateTime = DateTime.Now.AddHours(1);

// Add the record
service.PerfLogs_Add(authData, log);

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 PerfLog object
PerfLog log = new PerfLog();

log.setTask("Show Test Results");
try
{
  XMLGregorianCalendar startTime;
  XMLGregorianCalendar finishTime;
  startTime = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar());
  finishTime = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar());
  finishTime.setHour(startTime.getHour() + 1);
  log.setBeginDateTime(startTime);
  log.setEndDateTime(finishTime);
}
catch (Exception e)
{
  e.printStackTrace();
}

// Add the record
service.perfLogsAdd(authData, log);

Sample Request XML

POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 614 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/PerfLogs_Add"
 

<?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>
    <PerfLogs_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>8162</DeptId>
        <ProjId>11873</ProjId>
        <UserId>24661</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <PerfLog>
        <Task>Show Test Results</Task>
        <BeginDateTime>2014-07-11T10:59:08</BeginDateTime>
        <EndDateTime>2014-07-12T11:59:08</EndDateTime>
      </PerfLog>
    </PerfLogs_Add>
  </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: 622 {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>
    <PerfLogs_Add xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>8162</DeptId>
        <ProjId>11873</ProjId>
        <UserId>24661</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
      <PerfLog>
        <Task>Show Test Results</Task>
        <BeginDateTime>2014-07-11T10:59:08</BeginDateTime>
        <EndDateTime>2014-07-12T11:59:08</EndDateTime>
      </PerfLog>
    </PerfLogs_Add>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 306 {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>
    <PerfLogs_AddResponse 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: 316 {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>
    <PerfLogs_AddResponse xmlns="http://www.pragmaticsw.com/" />
  </soap12:Body>
</soap12:Envelope>

See Also

PerfLog Operations
Helper Operations
SOAP API Reference

Highlight search results