You are here: Entitlement Management > Entitlement Service Agreement Attributes > getServiceAgreementAttributes

Retrieve Service Agreement Attributes for a Line Item

Description

Retrieves service agreement attributes inside a line item.

Default Protocol Method Type URI
HTTPS GET getServiceAgreementAttributes.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 getServiceAgreementAttributes.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/getServiceAgreementAttributes.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

<emsResponse>
    <stat>ok</stat>
    <itemServiceAgreement>
        <entProductSAId>1</entProductSAId>
        <serviceAgreement>
            <serviceAgreementId>1</serviceAgreementId>
            <serviceAgreementName>Service Agreement Template</serviceAgreementName>
        </serviceAgreement>
        <itemServiceAgreementAttributes>
            <itemServiceAgreementAttribute>
                <attributeId>1</attributeId>
                <attributeName>Billing Cycle</attributeName>
                <attributeValue>43200</attributeValue>
                <groupName>Preferences</groupName>
                <subGroupName>Billing Preferences</subGroupName>
                <overridable>false</overridable>
            </itemServiceAgreementAttribute>
            <itemServiceAgreementAttribute>
                <attributeId>2</attributeId>
                <attributeName>Day</attributeName>
                <attributeValue>15</attributeValue>
                <groupName>Preferences</groupName>
                <subGroupName>Billing Preferences</subGroupName>
                <overridable>false</overridable>
            </itemServiceAgreementAttribute>
            <itemServiceAgreementAttribute>
                <attributeId>3</attributeId>
                <attributeName>Policy (days)</attributeName>
                <attributeValue>1440</attributeValue>
                <groupName>Preferences</groupName>
                <subGroupName>Aggregation Preferences</subGroupName>
                <overridable>false</overridable>
            </itemServiceAgreementAttribute>
            <itemServiceAgreementAttribute>
                <attributeId>4</attributeId>
                <attributeName>Frequency (in minutes)</attributeName>
                <attributeValue>01</attributeValue>
                <groupName>Preferences</groupName>
                <subGroupName>Aggregation Preferences</subGroupName>
                <overridable>true</overridable>
            </itemServiceAgreementAttribute>
        </itemServiceAgreementAttributes>
    </itemServiceAgreement>
</emsResponse>
See Also:

Output Format for Failure

Error Codes

Error Code Description
101 You are not authorized to use this service.
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.]
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.