You are here: Catalog Elements > Product > changeProductLifeCycleStage

Change Lifecycle Stage of a Product

Description

Change the lifecycle stage of a product for a given product ID. The lifecycle stage can be — Draft, Complete, End of Life (EOL).

Notes

Default Protocol Method Type URI
HTTPS POST changeProductLifeCycleStage.xml

Post Parameters

Parameter Description Valid Values Optional
productId Specify the product ID. Integer (>0) No

Sample Code

import java.io.IOException;
//..............................
//..............................
//..............................
import org.apache.http.params.HttpParams;
public class EMSSample {
        private static DefaultHttpClient httpclient = new DefaultHttpClient();
        private static Principal principal = null;
        //..............................
        //..............................
        //..............................
        public static String changeProductLifeCycleStage.xml()throws Exception {
                if(!verifyLogin()){
                        return "login failed";
                }
                HttpContext context = new BasicHttpContext();
                context.setAttribute(ClientContext.USER_TOKEN, principal);
                HttpPost post = new HttpPost("https://localhost:8080/ems/3.6/changeProductLifeCycleStage.xml");
                List<NameValuePair> nvps = new ArrayList<NameValuePair>();
                nvps.add(new BasicNameValuePair("productId", ""));
                post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
                HttpResponse response = httpclient.execute(post, 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);
        }
}

Sample Response

<?xml version="1.0" encoding="UTF-8"?>
<emsResponse>
    <lifeCycleStage>Complete</lifeCycleStage>
    <productId>16</productId>
    <stat>ok</stat>
</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.
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.]
128 You should log on first.
132 The URL address does not exist.
301 Unable to find product for ID ‘Id’
1006 ‘productName’ is already in End Of Life state.
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.