You are here: Entitlement Management > Entitlement > updateEntitlementAttributeForAllFeatures

Update Entitlement Attribute for All Features

Description

Change attribute value for given/all features for an entitlement.The entitlement should be in the Draft stage.

Default Protocol Method Type URI
HTTPS POST updateEntitlementAttributeForAllFeatures.xml

Post Parameters

Parameter Description Valid Values Optional
entId

Identifier of the entitlement.

Note: The entId is the handle returned by the createEntitlement.xml web service. You can use the searchEntitlements.xml web service to retrieve entId for an entitlement.

Integer No
attrId Specify the attribute ID. Integer No
attrValue Specify the value of the attribute. String No
ftrIds

Specify the unique record ID of a feature (as stored in EMS database), the attribute corresponding to which is to be updated.

String (comma separated feature IDs) Yes

The attrId parameter is same as the <attributeId> element returned by the getEntFeatureLMAttributes Web service.

Sample Code

import java.io.IOException;
//..............................
//..............................
//..............................
import org.apache.http.params.HttpParams;
public class EMSSample {
        private static DefaultHttpClient httpclient = new DefaultHttpClient();
        private static Principal principal = null;
        //..............................
        //..............................
        //..............................
        public static String updateEntitlementAttributeForAllFeatures.xml()throws Exception {
                if(!verifyLogin()){
                        return "login failed";
                }
                HttpContext context = new BasicHttpContext();
                context.setAttribute(ClientContext.USER_TOKEN, principal);
                HttpPost post = new HttpPost("https://localhost:8080/ems/3.6/updateEntitlementAttributeForAllFeatures.xml");
                List<NameValuePair> nvps = new ArrayList<NameValuePair>();
                nvps.add(new BasicNameValuePair("attrId", ""));
                nvps.add(new BasicNameValuePair("entId", ""));
                nvps.add(new BasicNameValuePair("ftrIds", ""));
                nvps.add(new BasicNameValuePair("attrValue", ""));
                post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
                HttpResponse response = httpclient.execute(post, context);
                HttpEntity entity = response.getEntity();
                byte[] b = null;
                if (entity != null) {
                        long l = entity.getContentLength();
                        b = new byte[(int) l];
                        entity.getContent().read(b);
                        entity.consumeContent();
                }
                return new String(b);
        }
}

Sample Response

<?xml version="1.0" encoding="UTF-8"?>
<emsResponse>
   <stat>ok</stat>
</emsResponse>
See Also:

Output Format for Failure

Error Codes

Error Code Description
100 Invalid request parameter.
101 You are not authorized to use this service.
118 {field} should be of data type integer. [Note: This error code is applicable for the fields - featureId, License modelId, entId, ftrId, customerId, lmId, templateType, lineItemId, CustomerId, stationCount, status, and granularity.]
122 {field} is a required field and should have a not null value. [Note: This error code is applicable for the fields - Eid, namespaceName, featureName, startDate, endDate, userIds, featureId, productName, productVersion, detailsLM, lmId, templateType, customAttribute, lineItemId, customerRefId, granularity, loginId, oldPassword, and newPassword.]
128 You should log on first.
132 The URL address does not exist.
695 Mentioned feature ids are not present in the Entitlement with id
696 Entitlement with id ‘entId’ does not exists.
697 No Attribute exists for given attribute Id.
801 Feature Ids should have a numeric value.
1040 Invalid attribute value.
1041 The given attributeId “attribute” is not updatable.
1074 Only Per Login counting type is allowed in concurrent license model for On-Premise(Entitlement level) entitlement.
1081 Invalid Web service version provided
1084 No Web service version provided
1088 The EMS system is running on HTTPS. Please provide the correct Web service URL.
1100 Invalid max usage limit. Max usage limit between 1 - 2147483647 is allowed.
1113 Only Per Identity Per Station counting type is allowed in concurrent license model for On-Premise Feature level entitlement.
1134 Invalid capacity value.Capacity value between 1 - 2147483647 is allowed.
1190 The start date cannot be equal to the end date.