You are here: State and Status Information > changeContractLineItemStatus

Change Contract Line Item Status

Description

Changes the line item status for the given line item ID. The status of line item can be:

The entitlement should be in the Complete lifecycle stage.

Default Protocol Method Type URI
HTTPS POST changeContractLineItemStatus.xml

Post Parameters

Parameter Description Valid Values Optional
lineItemId Specify line item ID. Integer No
status Specify the required line item status. Integer (0 - Enable, 1 - Disable, 2 - Revoke) No

Sample Code

import java.io.IOException;
import java.net.URLDecoder;
//..............................
//..............................
//..............................
import org.apache.http.params.HttpParams;
public class EMSSample {
        private static DefaultHttpClient httpclient = new DefaultHttpClient();
        private static Principal principal = null;
        private static StringBuffer query;
        //..............................
        //..............................
        //..............................
        public static String changeContractLineItemStatus.xml()throws Exception {
                if(!verifyLogin()){
                        return "login failed";
                }
                HttpContext context = new BasicHttpContext();
                context.setAttribute(ClientContext.USER_TOKEN, principal);
                HttpGet get = new HttpGet("https://localhost:8080/ems/3.6/changeContractLineItemStatus.xml");
                query = new StringBuffer();
                setParameter("status", "");
                setParameter("lineItemId", "");
                get.setURI(new URI(URLDecoder.decode(get.getURI() + query.toString(),"UTF-8")));
                HttpResponse response = httpclient.execute(get, 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);
        }
        static void setParameter(String key, String value) {
                if (query.toString().equals("")) {
                        query.append("?" + key + "=" + value + "&");
                } else {
                        query.append(key + "=" + value + "&");
                }
        }
}

Sample Response

<?xml version="1.0" encoding="UTF-8"?>
<emsResponse>
   <code>618</code>
   <desc>Could not find the entitlement line item.</desc>
   <stat>fail</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.
102 Invalid data entered.
107 An internal error occurred! Please report the error to System administrator.
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.]
120 {field} value is less than the minimum permitted value {value}. [Note: This error code is applicable for the fields - productd, featureId,entId, billType, lmId, lastModified, timeZoneId, customerId, 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.
618 Could not find the entitlement line item.
658 Entitlement is not in complete state, please contact Administrator.
1028 Entitlement is not marked complete.
1035 Invalid value for status Valid values are 0(enable), 1(Disable), 2(Revoke).
1036 LineItem does not exist in the given entitlement.
1037 Cannot Enable line item of a Disabled Contract.
1038 Status not updated as the status specified is already set.
1046 Line Item is already Revoked.
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.