ServerProperties_GetServerProperties Operation

Applies to QAComplete 14.5, last modified on August 06, 2024
Since release 10.2, this functionality is obsolete and is supported for backward compatibility only. We recommend that you use QAComplete REST API to access and manage data in QAComplete.

Returns the server’s local time, UTC time, and UTC offset. You may need these values to convert between the server time and your local time.

Parameters

The operation uses the following parameter

AuthenticationData  :  AuthenticationData, required

An AuthenticationData object that contains the login information.

Result

The ServerProperty object that contains the server’s local time, UTC time, and UTC offset.

Example

Sample Code

C#

ServiceSoapClient service = new ServiceSoapClient();

string login = "[email protected]";
string password = "p@ssword";

try
{
  // Preparing AuthenticationData
  LoginInfo loginInfo = service.GetLoginInfo("", login, password);
  AuthenticationData authData = new AuthenticationData();
  authData.AppCode = loginInfo.AppCode;
  authData.UserId = loginInfo.UserId;
  authData.PassCode = password;
  authData.ProjId = loginInfo.ProjId;
  authData.DeptId = loginInfo.DeptId;

  ServerProperty props = service.ServerProperties_GetServerProperties(authData);

  Console.WriteLine("Server's local time: {0}", props.ServerLocalTime);
  Console.WriteLine("Server's UTC time: {0}", props.ServerUTCTime);
  Console.WriteLine("Server's offset: {0} sec", props.ServerOffsetInSecs);
}
catch (FaultException ex)
{
  MessageFault msgFault = ex.CreateMessageFault();
  string error = msgFault.GetReaderAtDetailContents().GetAttribute("Text");

   Console.WriteLine(error);
}

Java

ServiceSoap service = new Service().getServiceSoap12();

String login = "[email protected]";
String password = "p@ssword";

try {
  // Preparing AuthenticationData
  LoginInfo loginInfo = service.getLoginInfo("", login, password);
  AuthenticationData authData = new AuthenticationData();
  authData.setAppCode(loginInfo.getAppCode());
  authData.setUserId(loginInfo.getUserId());
  authData.setPassCode(password);
  authData.setProjId(loginInfo.getProjId());
  authData.setDeptId(loginInfo.getDeptId());

  ServerProperty props = service.serverPropertiesGetServerProperties(authData);

  System.out.format("Server's local time: %s%n", props.getServerLocalTime().toString());
  System.out.format("Server's UTC time: %s%n", props.getServerUTCTime().toString());
  System.out.format("Server's offset: %d sec%n", props.getServerOffsetInSecs());
} catch (SOAPFaultException e) {
  e.printStackTrace();
}

Sample Request XML

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

<?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>
    <ServerProperties_GetServerProperties xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
    </ServerProperties_GetServerProperties>
  </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: 524 {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>
    <ServerProperties_GetServerProperties xmlns="http://www.pragmaticsw.com/">
      <AuthenticationData>
        <AppCode>agSP</AppCode>
        <DeptId>7154</DeptId>
        <ProjId>1032</ProjId>
        <UserId>25315</UserId>
        <PassCode>p@ssword</PassCode>
      </AuthenticationData>
    </ServerProperties_GetServerProperties>
  </soap12:Body>
</soap12:Envelope>

Sample Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 618 {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>
    <ServerProperties_GetServerPropertiesResponse xmlns="http://www.pragmaticsw.com/">
      <ServerProperties_GetServerPropertiesResult>
        <ServerLocalTime>2014-08-12T01:23:45.8</ServerLocalTime>
        <ServerUTCTime>2014-08-12T07:23:45.8</ServerUTCTime>
        <ServerOffsetInSecs>21600</ServerOffsetInSecs>
      </ServerProperties_GetServerPropertiesResult>
    </ServerProperties_GetServerPropertiesResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 628 {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>
    <ServerProperties_GetServerPropertiesResponse xmlns="http://www.pragmaticsw.com/">
      <ServerProperties_GetServerPropertiesResult>
        <ServerLocalTime>2014-08-12T01:23:45.8</ServerLocalTime>
        <ServerUTCTime>2014-08-12T07:23:45.8</ServerUTCTime>
        <ServerOffsetInSecs>21600</ServerOffsetInSecs>
      </ServerProperties_GetServerPropertiesResult>
    </ServerProperties_GetServerPropertiesResponse>
  </soap12:Body>
</soap12:Envelope>

See Also

Server Properties Operations
Helper Operations

Highlight search results