Allows you to add a specific error record to QAComplete’s database. You can use this operation to log errors for specific programmatic actions for later review.
Parameters
The operation uses the following parameters:
AuthenticationData : AuthenticationData, required
An AuthenticationData
object with the login information and the ID of the project to associate the error with.
DbLog : DbLog, required
A DbLog
object that contains the error information.
Result
None.
Remarks
The DbLog
object has matching UpdateUserId
and UserName
properties. To set them, specify the value only for the UpdateUserId
property. The UserName
property will be set automatically.
Example
Sample Code
C#
string login = "[email protected]";
string password = "p@ssword";
int projID = 10372;
ServiceSoapClient service = new ServiceSoapClient();
// Preparing 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 = projID;
// Preparing the DbLog object
DbLog dblog = new DbLog();
dblog.SeverityCode = "3-Error";
dblog.ErrSource = "MyClientApp";
dblog.ErrNumber = 12;
dblog.Description = "A defect with ID 544 was not found.";
// Logging the error
service.DbLogs_Add(authData, dblog);
Console.WriteLine("An error was logged.");
Java
String login = "[email protected]";
String password = "p@ssword";
int projID = 10372;
ServiceSoap service = new Service().getServiceSoap12();
// Preparing 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(projID);
// Preparing the DbLog object
DbLog dblog = new DbLog();
dblog.setSeverityCode("3-Error");
dblog.setErrSource("MyClientApp");
dblog.setErrNumber(12);
dblog.setDescription("A defect with ID 544 was not found.";
// Logging the error
service.dbLogsAdd(authData, dblog);
System.out.println("An error was logged.");
Sample Request XML
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 783 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/DBLogs_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>
<DBLogs_Add xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>7154</DeptId>
<ProjId>1032</ProjId>
<UserId>25315</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<DbLog>
<SeverityCode>3-Error</SeverityCode>
<ErrSource>MyClientApp</ErrSource>
<ErrNumber>12</ErrNumber>
<Description>A defect with ID 544 was not found.</Description>
<AppCode>agSP</AppCode>
<DateCreated>2014-07-30T01:40:17.007</DateCreated>
<ProjId>10372</ProjId>
<UserId>27942</UserId>
<UserName>Doe, John</UserName>
</DbLog>
</DBLogs_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: 791 {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>
<DBLogs_Add xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>7154</DeptId>
<ProjId>1032</ProjId>
<UserId>25315</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<DbLog>
<SeverityCode>3-Error</SeverityCode>
<ErrSource>MyClientApp</ErrSource>
<ErrNumber>12</ErrNumber>
<Description>A defect with ID 544 was not found.</Description>
<AppCode>agSP</AppCode>
<DateCreated>2014-07-30T01:40:17.007</DateCreated>
<ProjId>10372</ProjId>
<UserId>27942</UserId>
<UserName>Doe, John</UserName>
</DbLog>
</DBLogs_Add>
</soap12:Body>
</soap12:Envelope>
Sample Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 304 {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>
<DBLogs_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: 314 {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>
<DBLogs_AddResponse xmlns="http://www.pragmaticsw.com/" />
</soap12:Body>
</soap12:Envelope>
See Also
DbLog Operations
PerfLogs_Add
Helper Operations
SOAP API Reference