You are here: Machine Registration > addFingerprint

Add Fingerprint

Description

This Web service adds unique identification information (for example, fingerprint and host name) of customer’s machines to Cloud Connect database.

Default Protocol Method Type URI
HTTPS POST addFingerprint.xml

Post Parameters

Parameter Description Valid Values Optional
fingerPrintInfo Fingerprint XML of customer’s machine. String No

Input XML

The input of this Web service should be properly encoded to handle special characters.

<FingerPrintDetails>
  <CustomerList>
    <Customer>
      <CustomerRefId>C1</CustomerRefId>
      <FingerprintList>
        <Fingerprint>
          <FingerprintFriendlyName>fingerprint1</FingerprintFriendlyName>
          <CustomFingerprint>Noi1-51010</CustomFingerprint>
          <FingerprintValue>
            <hasp_info>
              <host_fingerprint type="SL-AdminMode" crc="2422381874">MXhJSSPcqVWSIA2aASDcJsWoxTeuotGzdNWq4Yn7IyxKaQk+UKpYHRGDoHl8IaKnBA1x5qguykuQKjaSQr8IeTEsVUYY0SLCWDBxhQNIRQ==</host_fingerprint>
              <host_fingerprint type="SL-UserMode" crc="3700693339">MnhJSQOBgkBO1HECAnOg4vHJFC8mId27UF1oxThE4bgITIx6RqaUlaZN4eTCGLAiBhJYSSlGAI6pAjOrPHcIqHBsClCRac4pBFQcWpYszxZDAPTin6gzJWKBdgSL</host_fingerprint>
            </hasp_info>
          </FingerprintValue>
        </Fingerprint>
      </FingerprintList>
    </Customer>
  </CustomerList>
</FingerPrintDetails> 

Understanding Input XML

The above values should be unique for a customer.

Registration Criteria

It is decided beforehand what criteria will be used for registering machines for a customer. The criteria can be:

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 addFingerprint.xml()throws Exception {
		if(!verifyLogin()){
			return "login failed";
		}
		HttpContext context = new BasicHttpContext();
		context.setAttribute(ClientContext.USER_TOKEN, principal);
		HttpPost post =  new HttpPost("https://localhost:8443/ems/3.6/addFingerprint.xml");
		List<NameValuePair> nvps = new ArrayList<NameValuePair>();
		nvps.add(new BasicNameValuePair("fingerPrintInfo", ""));
		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>
  <saved>true</saved>
  <stat>ok</stat>
</emsResponse>
See Also:

Output Format for Failure

Error Codes

Error Code Description
101 You are not authorized to use this service.
128 You should log on first.
1105 Customer does not exist. Provide a valid Customer Reference Id.
1110 FingerprintFriendlyName cannot be blank. Provide a valid XML.
1112 Either the FingerprintValue or FingerprintFriendlyName is not unique for the customer. Please provide the unique values.
1114 Invalid XML string provided. Provide a valid XML.
1127 Fingerprint friendly name cannot be greater than 255 characters.
1129 Error occurred while decoding the fingerprint value. Please contact the system administrator for further assistance.
1130 The Customer Ref ID cannot be blank.
1131 VendorCode is either null or empty for the tenant.
1133 Invalid Tenant Id in use.
1136 Invalid criteria for finger print matching. Please contact the system administrator for further details.
1137 Invalid primary criteria.
1138 CustomFingerprint is mandatory. Please provide a valid value.
1139 CustomFingerprint value should be unique for a customer.
1144 Invalid length of CustomFingerprint. Maximum allowed length is 255.