You are here: Usage Information > retrieveDetachData

Retrieve Detached Session Data

Retrieves information of feature level detached sessions for a customer for the given dates. This Web service is supported only for on-premise deployment mode.

This Web service can be called only with the ISV login.



Default Protocol Method Type URI




Query Parameters

Parameter Description Valid Values Optional

Start date from when the usage log is to be obtained.

The startDate should be earlier than or same as the enddate.

String (yyyy-mm- dd) No
endDate End date till when the usage bill is to be obtained. String (yyyy-mm- dd) No
customerRefId The unique reference ID of the customer. String Yes

Specify the EID to login to EMS.

Please note that EID and EntId are different.

  • EID: It is a globally unique identifier assigned to a newly created entitlement. This EID can be used by end users for EMS login (if configured). You can view EID for a given entitlement on EMS GUI, for example on View Entitlement Certificate screen.
  • EntId: It is the web service handle returned on the successful creation of an entitlement. This handle can be used for calling other web services related to entitlement management.
String Yes
productName Name of the product. String Mandatory if productVersion is provided. Otherwise, it is optional.
productVersion Version of the product. String Mandatory if productName is provided. Otherwise, it is optional.

Feature ID.

The authorization is done either on featureID or on featureName. You should provide only one of these feature identifiers; otherwise an error is returned.

Please note that ftrId and featureId are different.

  • ftrId: It is an auto-generated, unique record ID of a feature in EMS database.
  • featureId: It is the unique identification code provided by software provider for a feature. It is used in license enforcement.




The unique feature name.

The authorization is done either on featureID or on featureName. You should provide only one of these feature identifiers; otherwise an error is returned.

String Yes
pageIndex The starting page number. Integer (>0) Default Value: 1 Yes

Number of records to be displayed on a page.

Its default value can be configured from EMS Admin Console by using the Max Records Per Response (Web Services) property.

Integer (>0) Yes

Specifies whether or not to include revoked entitlements in the response. Possible values are:

  • 3 : Include revoked entitlements in the response. This is the default value.
  • 4: Do not include revoked entitlements in the response.
Integer Yes

Sample Code


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 retrieveDetachData.xml()throws Exception  {
                return "login failed";
    HttpContext context = new BasicHttpContext();
    context.setAttribute(ClientContext.USER_TOKEN, principal);
         HttpGet get = new HttpGet("https://localhost:8443/ems/3.6/retrieveDetachData.xml");
    query = new StringBuffer();
    setParameter("featureName", "");
    setParameter("startDate", "2014-01-01");
    setParameter("customerRefId", "");
    setParameter("pageSize", "");
    setParameter("featureId", "");
    setParameter("endDate", "2015-01-01");
    setParameter("productVersion", "");
    setParameter("productName", "");
    setParameter("eid", "");
    setParameter("pageIndex", "");
    setParameter("status", "1");
    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];
                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

  <Customer RefId="FL">
    <Entitlement Id="958d1179-c7df-4130-9c28-3bf3576fd996">
      <Product Name="PRODPIPS" Version="1.0">
        <Feature Id="5" Name="PIPS2" LicenseModel="Subscription_Concurrent" UsageType="TimeBased" ConcurrentLimit="10" ConcurrencyDefinition="PerIdentityPerStation">
            <User Name="user">
              <Record Id="1">
                <StartDateTime>2014-09-17 09:01:27</StartDateTime>
                <EndDateTime>2014-09-17 10:01:27</EndDateTime>
                <ActualEndDateTime>2014-09-17 09:03:16</ActualEndDateTime>
                <SessionDuration Unit="Seconds">109</SessionDuration>
                <ReportingPeriodDuration Unit="Seconds">109</ReportingPeriodDuration>
              <Record Id="2">
                <StartDateTime>2014-09-17 02:55:42</StartDateTime>
                <EndDateTime>2014-09-17 03:55:42</EndDateTime>
                <ActualEndDateTime>2014-09-17 02:56:28</ActualEndDateTime>
                <SessionDuration Unit="Seconds">46</SessionDuration>
                <ReportingPeriodDuration Unit="Seconds">46</ReportingPeriodDuration>

In the above response:

See Also:

Output Format for Failure

Error Codes

Error Code Description


You are not authorized to use this service.

102 Invalid data entered.


An internal error occurred! Please report the error to System administrator.


{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.]


Start date cannot be greater than end date.

1175 {field0} is mandatory if {field1} is provided. Note: This error code is applicable for the following fields: productName and productVersion.
1176 Invalid {field}. Note: This error code is applicable for the following fields: formatType, outputMode, vendorData, and status.
1191 Invalid request, either {field0} or {field1} should be provided in the request. Here, {field0} represents featureId, entId, or eid; and {field1} represents featureName or status.