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

Retrieve Entitlement Line Item Feature License Model Association

Description

Retrieves a list of license models for features which are associated with a line item and are in On state. For user information, the line item product name, ID, and version are also returned.

In the XML returned by the retrieveLineItemFeatureLMAssociation Web service, the values of the <Selected> tag indicate the following:

  1. 1 = License model is selected
  2. 0= License model is not selected, although the given feature contains this license model
Default Protocol Method Type URI
HTTPS GET retrieveLineItemFeatureLMAssociation.xml

GET Parameter

Parameter Description Valid Values Optional
lineItemId 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 retrieveLineItemFeatureLMAssociation.xml()throws Exception  {
		if(!verifyLogin()){
			return "login failed";
		}
		HttpContext context = new BasicHttpContext();
		context.setAttribute(ClientContext.USER_TOKEN, principal);
		HttpGet get = new HttpGet("https://localhost:8443/ems/3.6/retrieveLineItemFeatureLMAssociation.xml");
		query = new StringBuffer();
		setParameter("lineItemId", "1");
		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

<emsResponse>
  <stat>ok</stat>
  <lineItem>
    <lineItemId>1</lineItemId>
    <itemProduct>
      <product>
        <productId>2</productId>
        <productName>P1</productName>
        <productVersion>2.2</productVersion>
      </product>
    </itemProduct>
  </lineItem>
  <features>
    <feature>
      <id>1</id>
      <featureName>F1</featureName>
      <licenseModels>
        <licenseModel>
          <licenseModelId>2</licenseModelId>
          <licenseModelName>Postpaid</licenseModelName>
          <licenseModelDescription>Postpaid License
          Model</licenseModelDescription>
          <enfVersion>2.2.0</enfVersion>
          <enfName>2.2.0</enfName>
          <selected>0</selected>
        </licenseModel>
        <licenseModel>
          <licenseModelId>3</licenseModelId>
          <licenseModelName>Concurrent</licenseModelName>
          <licenseModelDescription>Subscription with Controlled
          Concurrency</licenseModelDescription>
          <enfVersion>2.2.0</enfVersion>
          <enfName>2.2.0</enfName>
          <selected>0</selected>
        </licenseModel>
        <licenseModel>
          <licenseModelId>4</licenseModelId>
          <licenseModelName>PrePaid</licenseModelName>
          <licenseModelDescription>Prepaid License
          Model</licenseModelDescription>
          <enfVersion>2.2.0</enfVersion>
          <enfName>2.2.0</enfName>
          <selected>1</selected>
        </licenseModel>
        <licenseModel>
          <licenseModelId>1</licenseModelId>
          <licenseModelName>Subscription</licenseModelName>
          <licenseModelDescription>Subscription License
          Model</licenseModelDescription>
          <enfVersion>2.2.0</enfVersion>
          <enfName>2.2.0</enfName>
          <selected>0</selected>
        </licenseModel>
      </licenseModels>
    </feature>
  </features>
</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.]
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.
682 The line item does not exist.
1081 Invalid Web service version provided
1084 No Web service version provided