private static LicenseManagementWSClient CreateLicenseManagementClient( Credentials credentials ) { //System.Net.ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(Validator); LicenseManagementWSClient client = new LicenseManagementWSClient("WSHttpBinding_ILicenseManagementWS"); client.ClientCredentials.UserName.UserName = credentials.Username; client.ClientCredentials.UserName.Password = credentials.Password; return client; }
private static LicenseManagementWSClient CreateLicenseManagementClient(Credentials credentials) { //System.Net.ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(Validator); LicenseManagementWSClient client = new LicenseManagementWSClient("WSHttpBinding_ILicenseManagementWS"); client.ClientCredentials.UserName.UserName = credentials.Username; client.ClientCredentials.UserName.Password = credentials.Password; return(client); }
public License CreateLicenseFromSkuId(string skuId) { LicenseManagementWSClient client = CreateLicenseManagementClient(_clientCredentials); try { LicenseInfo licenseInfo = client.GetSkuById(skuId).LicenseInfo; //Issue License from License info License license = client.CreateLicense(licenseInfo); client.Close(); return(license); } catch (FaultException apiEx) { client.Abort(); throw apiEx; } }