Use the Preferences_IsExtensionRestricted
operation to determine whether an extension (Automated Testing Bridge for QTP, Automated Testing Bridge for TestComplete, Web Service, and so on) is available for a user.
Parameters
The operation uses the following parameters:
AuthenticationData : , required
An AuthenticationData
object containing the login information.
ExtensionName : string, required
Name of the extension you want to check. Possible values are:
- AutomatedTestingBridgeQTP
- AutomatedTestingBridgeTC
- WebService
- swpSync.NET
Result
True if the extension is restricted (not available). False otherwise.
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;
string extensionName = "AutomatedTestingBridgeQTP";
bool result = service.Preferences_IsExtensionRestricted(authData, extensionName);
Console.WriteLine(result.ToString());
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());
String extensionName = "AutomatedTestingBridgeQTP";
Boolean result = service.preferencesIsEntityRestricted(authData, extensionName);
System.out.println(result);
Sample Request XML
POST /psws/psws.asmx HTTP/1.1
Host: myteam.mysite.com
Content-Type: text/xml; charset=utf-8
Content-Length: 567 {Insert an appropriate value here}
SOAPAction: "http://www.pragmaticsw.com/Preferences_IsExtensionRestricted"
<?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>
<Preferences_IsExtensionRestricted xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>8162</DeptId>
<ProjId>11873</ProjId>
<UserId>24661</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<ExtensionName>AutomatedTestingBridgeQTP</ExtensionName>
</Preferences_IsExtensionRestricted>
</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: 575 {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>
<Preferences_IsExtensionRestricted xmlns="http://www.pragmaticsw.com/">
<AuthenticationData>
<AppCode>agSP</AppCode>
<DeptId>8162</DeptId>
<ProjId>11873</ProjId>
<UserId>24661</UserId>
<PassCode>p@ssword</PassCode>
</AuthenticationData>
<ExtensionName>AutomatedTestingBridgeQTP</ExtensionName>
</Preferences_IsExtensionRestricted>
</soap12:Body>
</soap12:Envelope>
Sample Response XML
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 457 {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>
<Preferences_IsExtensionRestrictedResponse xmlns="http://www.pragmaticsw.com/">
<Preferences_IsExtensionRestrictedResult>false</Preferences_IsExtensionRestrictedResult>
</Preferences_IsExtensionRestrictedResponse>
</soap:Body>
</soap:Envelope>
SOAP 1.2
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 467 {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>
<Preferences_IsExtensionRestrictedResponse xmlns="http://www.pragmaticsw.com/">
<Preferences_IsExtensionRestrictedResult>false</Preferences_IsExtensionRestrictedResult>
</Preferences_IsExtensionRestrictedResponse>
</soap12:Body>
</soap12:Envelope>
See Also
Preferences_IsEntityRestricted
Preference Operations
Helper Operations
SOAP API Reference