You are here: Entitlement Management > Entitlement Line Item > getEntitlementItemById

Retrieve Entitlement Line Item Details

Description

Retrieve entitlement line item details by lineItemId.

Default Protocol Method Type URI
HTTPS GET getEntitlementItemById.xml

Query Parameters

Parameter Description Valid Values Optional
lineItemId Specify the line item ID. Integer 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 getEntitlementItemById.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/getEntitlementItemById.xml");
                query = new StringBuffer();
                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

For Cloud Deployment

<emsResponse>
  <stat>ok</stat>
  <lineItem>
    <lineItemId>1</lineItemId>
    <lineItemName>PostPaid</lineItemName>
    <status>0</status>
    <type>service</type>
    <enforcement>
      <enforcementId>1</enforcementId>
      <enforcementName>Sentinel Cloud</enforcementName>
      <enforcementVersion>3.6.0</enforcementVersion>
    </enforcement>
    <entitlement>
      <entId>1</entId>
      <eid>4e0d6b****</eid>
      <timezone>(GMT-09:00) Alaska</timezone>
    </entitlement>
    <itemProduct>
      <itemFeatureLicenseModels>
        <itemFeatureLicenseModel>
          <entFtrLMId>1</entFtrLMId>
          <feature>
            <id>1</id>
            <featureName>PostPaid</featureName>
            <featureId>1</featureId>
          </feature>
          <licenseModel>
            <licenseModelId>2</licenseModelId>
            <licenseModelName>Postpaid</licenseModelName>
          </licenseModel>
        </itemFeatureLicenseModel>
      </itemFeatureLicenseModels>
      <product>
        <productId>1</productId>
        <productName>PostPaid</productName>
        <productVersion>3.6</productVersion>
        <refId1></refId1>
        <refId2></refId2>
      </product>
      <itemServiceAgreement>
        <entProductSAId>1</entProductSAId>
        <serviceAgreement>
          <serviceAgreementId>1</serviceAgreementId>
          <serviceAgreementName>Service Agreement
          Template</serviceAgreementName>
        </serviceAgreement>
      </itemServiceAgreement>
    </itemProduct>
    <refId1></refId1>
    <refId2></refId2>
    <creationTime>1334809071000</creationTime>
    <modificationTime>1334809137000</modificationTime>
  </lineItem>
</emsResponse>

For On-premise Deployment

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<emsResponse>
  <stat>ok</stat>
  <lineItem>
    <lineItemId>8</lineItemId>
    <lineItemName>P1</lineItemName>
    <status>0</status>
    <type>service</type>
    <enforcement>
      <enforcementId>1</enforcementId>
      <enforcementName>Sentinel Cloud</enforcementName>
      <enforcementVersion>3.6.0</enforcementVersion>
    </enforcement>
    <entitlement>
      <entId>8</entId>
      <eid>f68a2c****</eid>
      <timezone>(GMT) Greenwich Mean Time, : Dublin, Edinburgh, Lisbon, London</timezone>
    </entitlement>
    <itemProduct>
      <itemFeatureLicenseModels>
        <itemFeatureLicenseModel>
          <entFtrLMId>15</entFtrLMId>
          <feature>
            <id>2</id>
            <featureName>F2</featureName>
            <featureId>2</featureId>
          </feature>
          <licenseModel>
            <licenseModelId>1</licenseModelId>
            <licenseModelName>Subscription</licenseModelName>
          </licenseModel>
        </itemFeatureLicenseModel>
        <itemFeatureLicenseModel>
          <entFtrLMId>16</entFtrLMId>
          <feature>
            <id>1</id>
            <featureName>F1</featureName>
            <featureId>1</featureId>
          </feature>
          <licenseModel>
            <licenseModelId>2</licenseModelId>
            <licenseModelName>Postpaid</licenseModelName>
          </licenseModel>
        </itemFeatureLicenseModel>
      </itemFeatureLicenseModels>
      <product>
        <productId>1</productId>
        <productName>P1</productName>
        <productVersion>3.5</productVersion>
        <refId1/>
        <refId2/>
      </product>
      <itemServiceAgreement>
        <entProductSAId>8</entProductSAId>
        <serviceAgreement>
          <serviceAgreementId>1</serviceAgreementId>
          <serviceAgreementName>Service Agreement Template</serviceAgreementName>
        </serviceAgreement>
      </itemServiceAgreement>
    </itemProduct>
    <refId1>fl-ref1</refId1>
    <refId2>fl-ref2</refId2>
    <creationTime>1402476206000</creationTime>
    <modificationTime>1402479433000</modificationTime>
  </lineItem>
</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.
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.
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.