If your end user connects to the internet via a proxy server that requires authentication, you need to instruct the QLM API to connect through the proxy server with the proper credentials.
To do so, you need to prompt the user via a user interface to specify the credentials to use to connect through the proxy server. The QLM .NET Controls as well as the QLM License Wizard already provide a user interface for that purpose.
If you are not using the QLM .NET Controls or the QLM License Wizard, then you need to collect and set the following properties on the QlmLicense object:
- ProxyUser
- ProxyDomain
- ProxyPassword
- ProxyHost
- ProxyPort
After these properties are set, you can call any API that communicates with the QLM License Server.
To detect that the customer requires authentication through a proxy server, you need to catch the exception that is thrown when the QLM API fails.
try
{
license.ActivateLicense(...);
}
catch (System.Net.WebException wex)
{
if (wex.Message.IndexOf("407") != -1)
{
// Customer user proxy server that requires authentication.
// Configure the proxy settings - it is not recommended to put all this code in the catch clause - this is just to show you what APIs to call
license.ProxyUser = "xxx";
license.ProxyUser = "xxx";
license.ProxyUser = "xxx";
license.ActivateLicense (...);
}
else
{
// error
return;
}
}
catch (Exception ex)
{
// error
return;
}
Comments
0 comments
Please sign in to leave a comment.