You are here: Catalog Elements > License Model > licenseModelList

Retrieve List of License Models

Description

Retrieves a list of license models containing their details, such as ID, name, and description.

Default Protocol Method Type URI
HTTPS GET licenseModelList.xml

Query Parameters

None

Parameter Description Valid Values Optional
lastModified Creation or Modification time stamp. Long Yes
refId1 Information that uniquely identifies the license model in a different ERP system. String Yes
refId2 A second unique reference ID, similar to Ref ID 1. String Yes

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 licenseModelList.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/licenseModelList.xml");
		query = new StringBuffer();
		setParameter("refId2", "ref2");
		setParameter("lastModified", "1327379905000");
		setParameter("refId1", "ref1");
		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>
   <licenseModels>
      <licenseModel>
         <creationTime>1425870752000</creationTime>
         <licenseModelDescription>Subscription License Model</licenseModelDescription>
         <licenseModelId>1</licenseModelId>
         <licenseModelName>Subscription</licenseModelName>
         <modificationTime>1425870752000</modificationTime>
         <refId1 />
         <refId2 />
      </licenseModel>
      <licenseModel>
         <creationTime>1425870752000</creationTime>
         <licenseModelDescription>Postpaid License Model</licenseModelDescription>
         <licenseModelId>2</licenseModelId>
         <licenseModelName>Postpaid</licenseModelName>
         <modificationTime>1425870752000</modificationTime>
         <refId1 />
         <refId2 />
      </licenseModel>
      <licenseModel>
         <creationTime>1425870752000</creationTime>
         <licenseModelDescription>Subscription with Controlled Concurrency</licenseModelDescription>
         <licenseModelId>3</licenseModelId>
         <licenseModelName>Concurrent</licenseModelName>
         <modificationTime>1425870752000</modificationTime>
         <refId1 />
         <refId2 />
      </licenseModel>
      <licenseModel>
         <creationTime>1425870752000</creationTime>
         <licenseModelDescription>Prepaid License Model</licenseModelDescription>
         <licenseModelId>4</licenseModelId>
         <licenseModelName>PrePaid</licenseModelName>
         <modificationTime>1425870752000</modificationTime>
         <refId1 />
         <refId2 />
      </licenseModel>
   </licenseModels>
   <stat>ok</stat>
   <total>4</total>
</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.
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.]
128 You should log on first.
132 The URL address does not exist.
1080 {field} should be of dataType long. [Note: This error code is applicable for the field - lastModified.]
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.