You are here: Catalog Elements > Feature > viewFeatureById

Retrieving Feature Details for a Given Feature ID

Description

Retrieve the details of a feature for a given feature ID.

Default Protocol Method Type URI
HTTPS GET viewFeatureById.xml

Query Parameters

Parameter Description Valid Values Optional
ftrId

The auto-generated, unique record ID of a feature in EMS database.

Note: The ftrId is the handle returned by the addFeature.xml web service. You can retrieve ftrId by using the featureList.xml web service. In the response of this Web service, the value of tag 'id' under the 'feature' tag denotes ftrId.

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 viewFeatureById.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/viewFeatureById.xml");
                query = new StringBuffer();
                setParameter("ftrId", "");
                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>
   <feature>
      <creationTime>1425876439000</creationTime>
      <deployed>true</deployed>
      <desc />
      <enabled>true</enabled>
      <featureId>1</featureId>
      <id>1</id>
      <licenseModels>
         <licenseModel>
            <default>1</default>
            <enfName>Sentinel Cloud</enfName>
            <enfVersion>3.6.0</enfVersion>
            <id>2</id>
            <name>Postpaid</name>
         </licenseModel>
         <licenseModel>
            <default>0</default>
            <enfName>Sentinel Cloud</enfName>
            <enfVersion>3.6.0</enfVersion>
            <id>3</id>
            <name>Concurrent</name>
         </licenseModel>
         <licenseModel>
            <default>0</default>
            <enfName>Sentinel Cloud</enfName>
            <enfVersion>3.6.0</enfVersion>
            <id>4</id>
            <name>PrePaid</name>
         </licenseModel>
         <licenseModel>
            <default>0</default>
            <enfName>Sentinel Cloud</enfName>
            <enfVersion>3.6.0</enfVersion>
            <id>1</id>
            <name>Subscription</name>
         </licenseModel>
      </licenseModels>
      <modificationTime>1425876439000</modificationTime>
      <name>PT1</name>
      <namespaceId>1</namespaceId>
      <namespaceName>test36</namespaceName>
      <refId1 />
      <refId2 />
   </feature>
   <stat>ok</stat>
</emsResponse>

Here, the default tag is set to 1 for the default license model of a feature.

See Also:

Output Format for Failure

Error Codes

Error Code Description
100 Invalid request parameter.
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.
133 Invalid namespace.
309 Unable to find feature.
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.