Chapter 8 Using Information Service

Table Of Contents

Using Information Service

Information Service

Test Code


Using Information Service


Information Service

Information Service provide information about the CS and the System. This is carried out using the following APIs. Information Service uses the NBAPI Framework to deploy the Security Web Services.

Table 8-1 APIs for CS Information Service 

Return Values
Syntax
Description
 boolean
addCertificate(java.lang.Str
ing cert)

Adds the certificate in the Common Services trust store.This is specifically required for the self-signed certificates.

The argument to this API is certificate as base 64 encoded string

java.lang.String
getCSCertificate() 

Returns Common Services SSL certificate as a String. The Certificate is returned as base64 encoded string

boolean
removeCertificate(java.lang.
String cert)

Removes the certificate from the Common Service trust store.

java.lang.String
getCSNBIVersion()

Gets the CS NBI Version.

java.lang.String
getCSVersion()

Returns the Common Services version

java.util.Calendar
getServerTime() 

Gets the server current date and time zone.

java.lang.String
getVersion()

Get the version of this service


Test Code

This section provides test code for Information Service

//Declarations
 CSInformationServiceServiceLocator infoLoc;
 SecurityService_pkg.AxisServletSoapBindingStub _secService ;
 com.cisco.nm.nbi.cwcs.info.AxisServletSoapBindingStub _infoService ;


//Initialization 

//Attaching the cookie after login

((javax.xml.rpc.Stub)_infoService)._setProperty( "javax.xml.rpc.session.maintain", 
Boolean.TRUE);
((javax.xml.rpc.Stub)_infoService)._setProperty( HTTPConstants.HEADER_COOKIE, 
"JSESSIONID="+coreId +","+cookie.getCookie());


//Calling info service getCSVersion method

System.out.println("The version of CS is " + _infoService.getCSVersion());