You are here: Catalog Elements > Namespace > namespaceList

Retrieve Namespace By Name and Ref IDs

Description

Retrieve a namespace by name and ref IDs.

Default Protocol Method Type URI
HTTPS GET namespaceList.xml

Query Parameters

Parameter Description Valid Values Optional
namespaceName Name of the namespace. String Yes
refId1 Information that uniquely identifies the license model in a different ERP system. String Yes
refId2 A second unique reference ID, similar to Ref ID 1. String Yes
lastModified Creation or Modification time stamp. Long 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 namespaceList.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/namespaceList.xml");
		query = new StringBuffer();
		setParameter("namespaceName", "char");
		setParameter("refId2", "ref2");
		setParameter("lastModified", "1327379905000");
		setParameter("refId1", "ref1");
		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>
   <namespaces>
      <namespace>
         <creationTime>1429089170000</creationTime>
         <deployed>true</deployed>
         <desc />
         <modificationTime>1429089170000</modificationTime>
         <namespaceId>1</namespaceId>
         <namespaceName>N1</namespaceName>
         <refId1 />
         <refId2 />
      </namespace>
   </namespaces>
   <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.
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.
1080 {field} should be of dataType long. [Note: This error code is applicable for the field - lastModified.]
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.