You are here: On-premise License Management > retrieveActiveStation

Retrieve Active Stations

Description

This Web service retrieves information of on-premise machines on which detached licenses are in use. The information retrieved from this Web service is used by Delete Active Stations Web service for revoking detached licenses and freeing up the station count pool.

This Web service is available only for on-premise entitlement level licensing.

Default Protocol Method Type URI
HTTPS GET retrieveActiveStations.xml

Query Parameters

Parameter Description Valid Values Optional

customerId

Customer for whom you want to determine the machines on which detached licenses are active.

Integer

Yes

customerRefId

The unique reference ID of the customer.

String

Yes

customerName

Name of the customer.

String

Yes

entId

Identifier of the entitlement.

Note: The entId is the handle returned by the createEntitlement.xml web service. You can use the searchEntitlements.xml web service to retrieve entId for an entitlement.

Integer (>0) Yes

eid

A globally unique identifier assigned to a newly created entitlement. You can view EID for a given entitlement on EMS GUI, for example on View Entitlement Certificate screen.

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 retrieveActiveStations.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/retrieveActiveStations.xml");
    query = new StringBuffer();
    setParameter("customerName", "");
    setParameter("customerId", "1");
    setParameter("entId", "");
    setParameter("customerRefId", "");
    setParameter("eid", "");
    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>
   <customer name="cust1" refId="cust1">
      <entitlement eid="de084e56-139b-45e4-bbcf-3f8a1bd9a387">
         <activeStation>
            <friendlyName>FP2</friendlyName>
            <lastDetachedTime>2014-02-28 15:22:02.0</lastDetachedTime>
            <detachedDuration>28</detachedDuration>
            <fingerPrintId>2</fingerPrintId>
         </activeStation>
      </entitlement>
   </customer>
   <stat>ok</stat>
</emsResponse>

If there are no active stations available, the response shows the ok status and the desc element:

<desc>No active stations found</desc>
See Also:

Output Format for Failure

Error Codes

Error Code Description
101 You are not authorized to use this service.
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.
1155 Error in retrieving active stations information. Please contact the system administrator for further assistance.