Cisco Cisco Security Manager 4.0 Guia De Especificaciones
Cisco Security Manager 4.4 API Specification (Version 1.1)
OL- 29074-01
Page 158
8
Sample API Client Programs
NOTE: All the sample programs in this section are provided for simple demonstration
purposes only. The programs may need to be appropriately enhanced or modified for use
in production systems.
purposes only. The programs may need to be appropriately enhanced or modified for use
in production systems.
Running the java sample programs mentioned below need the following to be setup:
java CLASSPATH.
included in the java CLASSPATH
3. Define a CLASSPATH environment variable in your command shell include all the required jars and other
folders as necessary
4. A client.properties file must be defined and passed in as a parameter as a java program argument. The
format of the file is as follows:
The property definition are as follows:
The property definition are as follows:
USER: Defines the username of the user logging in.
PASSWORD: The user password
HOST: The host server to connect
XML_REQUEST: The XML request that needs to be sent (ping in this case)
LOGIN_REQUIRED: If true, a login is done before sending the XML_REQUEST.
URI: Optional URI parameter that indicates the service that needs to be invoked. If this is not
PASSWORD: The user password
HOST: The host server to connect
XML_REQUEST: The XML request that needs to be sent (ping in this case)
LOGIN_REQUIRED: If true, a login is done before sending the XML_REQUEST.
URI: Optional URI parameter that indicates the service that needs to be invoked. If this is not
specified in the property file, it must be passed in as a java program argument.
Please note that the property values in the client.properties file like HOST, USER, PASSWORD, other
values in the XML_REQUEST and the URI itself may need to modified to suit your deployment and the
sample that is being executed. Edit this file appropriately before executing any of programs mentioned
below.
USER=admin
PASSWORD=admin
HOST=localhost
XML_REQUEST=<?xml version=\"1.0\" encoding=\"UTF-8\"?>\
<csm:pingRequest xmlns:csm=\"csm\">\
PASSWORD=admin
HOST=localhost
XML_REQUEST=<?xml version=\"1.0\" encoding=\"UTF-8\"?>\
<csm:pingRequest xmlns:csm=\"csm\">\
<protVersion>1.0</protVersion>\
<reqId>3</reqId>\
</csm:pingRequest>
# Set LOGIN_REQUIRED to true if the URI supplied
# requires login to be done as a prerequisite.
LOGIN_REQUIRED=true
URI=https://localhost/nbi/ping
# Set LOGIN_REQUIRED to true if the URI supplied
# requires login to be done as a prerequisite.
LOGIN_REQUIRED=true
URI=https://localhost/nbi/ping