Overview of Web Services API



Similar documents
FTP, IIS, and Firewall Reference and Troubleshooting

Configuring Secure Socket Layer (SSL) for use with BPM 7.5.x

Configuring an Oracle Business Intelligence Enterprise Edition Resource in Metadata Manager

Using LDAP Authentication in a PowerCenter Domain

ADFS Integration Guidelines

Reference and Troubleshooting: FTP, IIS, and Firewall Information

etoken Enterprise For: SSL SSL with etoken

Integration with Active Directory

Adeptia Suite 6.2. Application Services Guide. Release Date October 16, 2014

Universal Content Management Version 10gR3. Security Providers Component Administration Guide

Java Access to Oracle CRM On Demand. By: Joerg Wallmueller Melbourne, Australia

Consuming a Web Service(SOAP and RESTful) in Java. Cheat Sheet For Consuming Services in Java

Configuring TLS Security for Cloudera Manager

ECA IIS Instructions. January 2005

CHAPTER 7 SSL CONFIGURATION AND TESTING

Configuring Load Balancing

Implementing a Web Service Client using Java

Setting Up SSL on IIS6 for MEGA Advisor

SETTING UP YOUR JAVA DEVELOPER ENVIRONMENT

Instructions to connect to GRCC Remote Access using a Macintosh computer

Upgrading Your Web Server from ClientBase Browser Version 2.0 or Above to Version 2.1.1

Exchange Reporter Plus SSL Configuration Guide

How To Enable A Websphere To Communicate With Ssl On An Ipad From Aaya One X Portal On A Pc Or Macbook Or Ipad (For Acedo) On A Network With A Password Protected (

Smart Policy - Web Collector. Version 1.1

How To Use Blackberry Web Services On A Blackberry Device

IBM Security QRadar Vulnerability Manager Version User Guide

Exchange 2010 PKI Configuration Guide

Creating and Managing Certificates for My webmethods Server. Version 8.2 and Later

Feith Dashboard iq Server Version 8.1 Install Guide

SafeNet KMIP and Google Cloud Storage Integration Guide

1. If there is a temporary SSL certificate in your /ServerRoot/ssl/certs/ directory, move or delete it. 2. Run the following command:

Installing, Uninstalling, and Upgrading Service Monitor

Cisco Prime Central Managing Certificates

Step-by-Step Setup Guide Wireless File Transmitter FTP Mode

Installation Logon Recording Basis. By AD Logon Name AD Logon Name(recommended) By Windows Logon Name IP Address

Onset Computer Corporation

SolarWinds Technical Reference

Configure Managed File Transfer Endpoints

Getting Started Guide

Best Practices for Disaster Recovery with Symantec Endpoint Protection

Enable SSL in Go2Group SOAP Server

GE Intelligent Platforms. Activating Licenses Online Using a Local License Server

Installing and Configuring vcenter Support Assistant

AXIS 70U - Using Scan-to-File

Funambol Exchange Connector v6.5 Installation Guide

Junio SSL WebLogic Oracle. Guía de Instalación. Junio, SSL WebLogic Oracle Guía de Instalación CONFIDENCIAL Página 1 de 19

Archive Attender Version 3.5

Installing the ASP.NET VETtrak APIs onto IIS 5 or 6

Setting Up Scan to SMB on TaskALFA series MFP s.

TECHNICAL NOTE Stormshield Network Firewall AUTOMATIC BACKUPS. Document version: 1.0 Reference: snentno_autobackup

Wavecrest Certificate

JAVS Scheduled Publishing. Installation/Configuration... 4 Manual Operation... 6 Automating Scheduled Publishing... 7 Windows XP... 7 Windows 7...

Configuring Steel-Belted RADIUS Proxy to Send Group Attributes

SSO Plugin. J System Solutions. Upgrading SSO Plugin 3x to 4x - BMC AR System & Mid Tier.

Login with Amazon Getting Started Guide for Android. Version 2.0

By default, STRM provides an untrusted SSL certificate. You can replace the untrusted SSL certificate with a self-signed or trusted certificate.

Cox Managed CPE Services. RADIUS Authentication for AnyConnect VPN Version 1.3 [Draft]

How To Configure CU*BASE Encryption

Usage of Evaluate Client Certificate with SSL support in Mediator and CentraSite

Introduction to Mobile Access Gateway Installation

Installation valid SSL certificate

Configuring SSL in OBIEE 11g

Release Note RM Unify CSV Extraction Tool

NMR HTTP/FTP Data Download Package

Enabling Single-Sign-On on WebSphere Portal in IBM Cognos ReportNet

NovaBACKUP Remote Workforce Version 12.5 Cloud Restore

ProSystem fx Document

Clearswift Information Governance

LAE 5.1. Windows Server Installation Guide. Version 1.0

USING SSL/TLS WITH TERMINAL EMULATION

Using Internet or Windows Explorer to Upload Your Site

SSL Configuration on Weblogic Oracle FLEXCUBE Universal Banking Release [August] [2014]

2012 Nolio Ltd. All rights reserved

Installing and Configuring vcloud Connector

Bitrix Site Manager ASP.NET. Installation Guide

Appendix E. Captioning Manager system requirements. Installing the Captioning Manager

T320 E-business technologies: foundations and practice

IUCLID 5 Guidance and Support

WIRIS quizzes web services Getting started with PHP and Java

BlackBerry Enterprise Service 10. Version: Configuration Guide

Rev 7 06-OCT Site Manager Installation Guide

Millennium Drive. Installation Guide

RHEV 2.2: REST API INSTALLATION

Installation Guide. SafeNet Authentication Service

Secure Messaging Server Console... 2

How to Implement Two-Way SSL Authentication in a Web Service

Brekeke PBX Web Service

Installation and Configuration Guide

Install the Production Treasury Root Certificate (Vista / Win 7)

How to configure the DBxtra Report Web Service on IIS (Internet Information Server)

CIMHT_006 How to Configure the Database Logger Proficy HMI/SCADA CIMPLICITY

Amazon Glacier. Developer Guide API Version

Sophos Mobile Control Installation guide. Product version: 3.5

Novell ZENworks Asset Management 7.5

Implementation notes on Integration of Avaya Aura Application Enablement Services with Microsoft Lync 2010 Server.

Browser-based Support Console

Installing Globodox Web Client on Windows Server 2012

Web Services using Tomcat and Eclipse

HP Service Manager. Mobile Applications. For the Supported Windows and UNIX operating systems Software Version: 1.0. Document Release Date: July 2011

Transcription:

1 CHAPTER The Cisco IP Interoperability and Collaboration System (IPICS) 4.5(x) application programming interface (API) provides a web services-based API that enables the management and control of various Cisco IPICS operations through programmatic interfaces and custom applications. The API includes a set of functions to control Cisco IPICS operations such as VTG creation, policy invocation, user management, and more. This chapter introduces general concepts that relate to the web services API. It also explains how to generate a client stub by using the Eclipse integrated development environment (IDE), and explains options for executing API requests. This chapter includes these topics: Generating a Web Services Client Stub, page 1-1 Creating and Executing API Client Code, page 1-3 API Client Code Example, page 1-4 API Security, page 1-7 API Logging, page 1-8 Generating a Web Services Client Stub Before using the Cisco IPICS API web services functions, you must generate a client stub on the PC that is to be used for the API development (the developer workstation). (A client stub is not used with the REST-based API functions.) You can use a variety of tools to generate a client stub. The following sections describe how to generate the stub by using the Eclipse IDE. Obtaining and Configuring the Eclipse IDE, page 1-2 Generating a Client Stub on a Developer Workstation, page 1-2 1-1

Generating a Web Services Client Stub Chapter 1 Obtaining and Configuring the Eclipse IDE Before you generate a web services client stub for the Cisco IPICS API, follow these steps to obtain and configure the Eclipse IDE: Step 1 Step 2 Step 3 On the developer workstation, download the Eclipse IDE for Java Developers package from the Galileo (v 3.5.2) release of the Eclipse open-source IDE. This IDE is available from the Eclipse website. On the developer workstation, download and extract Axis2 version 1.3 from the Apache website Take these actions to configure Axis2 runtime in the Eclipse IDE: a. Launch the Eclipse IDE. b. Choose Windows > Preferences. c. In the Preferences window. expand Web Services. d. Click Axis2 Preferences. e. Click Browse and, in the Browse to a Folder window, click the folder in which you extracted Axis2. f. Click OK. g. Click OK to exit the Preference window. Generating a Client Stub on a Developer Workstation The following procedure describes how to use the Eclipse IDE to generate a client stub on a developer workstation. Before you perform this procedure, configure the Eclipse IDE on the developer workstation as described in the Obtaining and Configuring the Eclipse IDE section on page 1-2. Procedure Step 1 Step 2 Launch the Eclipse IDE and take these actions: a. Choose File > New > Other... > Web Services > Web ServiceClient. b. Click Next. The Web Services Client window appears. In the Web Services Client window, take these actions: a. In the service definition field, enter the following URL, where cisco_ipics_server is the host name or IP address of your server: http://cisco_ipics_server/ipics_server/services/ipicswebservice?wsdl b. Make sure that the Client type field displays Java Proxy. c. Click the Server: Tomcat version Server hyperlink. The Client Environment Configuration window appears. 1-2

Chapter 1 Creating and Executing API Client Code Step 3 Step 4 Step 5 Step 6 Step 7 Step 8 In the Client Environment Configuration window, take these actions: a. In the Server area, choose the server type that Eclipse uses when generating the stub (by default, the server type is Tomcat vx.x Server. b. Click OK. In the Web Services Client window, take these actions, click the Web service runtime: Apache Axis hyperlink. The Client Environment Configuration window appears. In the Client Environment Configuration window, take these actions: a. Click Apache Axis2 in the Web service runtime area. b. Click OK. In the Web Services Client window, take these actions, click the Client project hyperlink. In the Specify Client Project Settings window, take these actions: a. In the Client project field, enter a name for the client project. b. Make sure that the Client Project field displays Dynamic Web Project. c. Click OK. d. Click Next. The Web Service Client window appears. In the Web Service Client window, click Finish. The client stub is generated in a folder with the name that you specified in the Specify Client Project Settings window. Creating and Executing API Client Code Each API service function (except the executepolicyforuser function) requires a valid session ID to access the API functions. To start a new web services session, the client code must call the startsession function and provide the login name and password that are used to authenticate the user who executes the API code. After authentication completes, the startsession method returns a unique SessionId value, which should be used when executing subsequent API methods in a web service session. To end a session, the API client code must call the endsession function, which invalidates the current SessionId and is important for security. For additional information about using the API, see the Function Guidelines section on page 2-1. After you create API client code, follow these steps to execute it: Procedure Step 1 Launch the Eclipse IDE and take these actions: a. Click the name of the client file in the left panel of the window. b. Choose Run > Run Configurations... The Run Configurations window appears. 1-3

API Client Code Example Chapter 1 Step 2 In the Run Configurations window, take these actions: a. Right-click Java Application in the left panel of the window. b. Choose New. c. Click Run. API Client Code Example The following is an example of Cisco API client code for the web services functions. In this example: The location of the keystore is specified. The keystore contains the SSL certificate that the Cisco IPICS server uses to verify its identity when a client attempts to connect to the server, and the URL for the web service endpoint. The startsession function is executed. This function returns a unique sessionid, which is needed to execute other web service functions. The getipicsversion is executed. This function returns the Cisco IPICS version that is running on the Cisco IPICS sever. These VTG functions are executed: createvtg Create a new VTG on the Cisco IPICS server and returns the ID of the VTG, activates VTG and returns list of all VTG's present in the system respectively. activatevtg Activates the newly-created VTG. getallvtgs Retrieves a list of all VTGs that are present in Cisco IPICS. The endsession function is executed. This function terminate the web service session. A terminated session cannot be used again. package com.example; import java.rmi.remoteexception; import com.example.ipicswebservicestub.*; public class IpicsWebServiceTestClient { // The web service stub private static IpicsWebServiceStub ws = null; // // Modify the following parameters as needed for your environment // // Update with your server's address. // Note: The use of HTTPS/SSL is optional, but highly recommended. private static final String WEB_SERVICE_ENDPOINT_URL = "https://<my_server_address>/ipics_server/services/ipicswebservice"; // If you use SSL to connect to the server, update with the location // of your trusted SSL certificate key store (sometimes also called // a "trust store"). private static final String KEY_STORE_FILE = "c:\\client_truststore.jks"; // Choose the client type: IDC or IPHONE // Affects how clients show up in the Active Users page found in the // Cisco IPICS Administration Console. private static final String CLIENT_TYPE = "IDC"; 1-4

Chapter 1 API Client Code Example // Update with the IPICS user login used to connect to the server. // Use of the default "ipics" user account is not recommended, but // shown here for simplicity. private static final String USER_LOGIN = "ipics"; // Update with the corresponding IPICS user password. private static final String USER_PASSWORD = "secret"; public static void main(string[] args) { String sessionid = null; try { // Note: Use Java keytool to import the server's SSL certificate // into KEY_STORE_FILE before running this client application, // otherwise your SSL connection will fail. System.setProperty("javax.net.ssl.trustStore", KEY_STORE_FILE); // Create web service stub object using end-point URL ws = new IpicsWebServiceStub(WEB_SERVICE_ENDPOINT_URL); sessionid = teststartsession(); System.out.println("Session ID : " + sessionid); testgetipicsversion(sessionid); int vtgid = testcreatevtg(sessionid); testactivatevtg(sessionid, vtgid); testgetallvtgs(sessionid); testendsession(sessionid); catch (Exception e) { e.printstacktrace(); private static String teststartsession() throws Exception { ClientDescriptorVO cd = new ClientDescriptorVO(); cd.setclienttype(client_type); StartSession params = new StartSession(); params.setclientdescriptor(cd); params.setuserlogin(user_login); params.setpass(user_password); SessionVO result = ws.startsession(params).get_return(); if (result.geterrorvo()!= null) { System.out.println(result.getErrorVO().getErrorMessages()); return null; String sessionid = result.getsessionid(); return sessionid; private static String testgetipicsversion(string sessionid) throws RemoteException { System.out.println("\n----------- GetIpicsVersion ----------- "); GetIpicsVersion params = new GetIpicsVersion(); 1-5

API Client Code Example Chapter 1 StringVO result = ws.getipicsversion(params).get_return(); if (result.geterrorvo() == null) { System.out.println("\nIPICS Version: " + result.getvalue()); return result.getvalue(); else { System.out.println("\nIPICS Version: " + result.geterrorvo().geterrormessages()); return null; private static int testcreatevtg(string sessionid) { System.out.println("\n----------- Create VTG ----------- "); CreateVtg params = new CreateVtg(); params.setvtgname("vtg1"); params.setdescription("test VTG 1"); IntegerVO result = new IntegerVO(); try { result = ws.createvtg(params).get_return(); catch (RemoteException e) { e.printstacktrace(); if (result.geterrorvo()!= null) { System.out.println(result.getErrorVO().getErrorMessages()); return 0; System.out.println("\n VTG Id : " + result.getvalue()); return result.getvalue(); private static void testactivatevtg(string sessionid, int vtgid) throws Exception { System.out.println("\n----------- Activate VTG ----------- "); ActivateVtg params = new ActivateVtg(); params.setvtgid(vtgid); BooleanVO result = ws.activatevtg(params).get_return(); if (result.geterrorvo()!= null) { System.out.println(result.getErrorVO().getErrorMessages()); return; System.out.println("\n Return Value : " + result.getvalue()); private static VtgContainerVO testgetallvtgs(string sessionid) throws Exception { System.out.println("\n----------- Get All VTGs ----------- "); PaginationContextVO pc = new PaginationContextVO(); pc.setpagenumber(1); pc.setpagerecords(100); pc.settotalrecords(100); GetAllVtgs params = new GetAllVtgs(); params.setpc(pc); 1-6

Chapter 1 API Security VtgContainerVO result = ws.getallvtgs(params).get_return(); if (result.geterrorvo()!= null) { System.out.println(result.getErrorVO().getErrorMessages()); return null; System.out.println("VTG container length : " + result.getvtgvos().length); System.out.println("VTG Total Records : " + result.getpaginationcontextvo().gettotalrecords()); System.out.println("VTG Total Pages : " + result.getpaginationcontextvo().gettotalpages()); return result; private static void testendsession(string sessionid) throws Exception { System.out.println("\n----------- End Session ------------ "); EndSession params = new EndSession(); ws.endsession(params); System.out.println("Session ID deleted successfully."); API Security The Cisco IPICS server and the Cisco IPICS API use SSL for secure communication between the server and client systems. The server uses a X.509 certificate (also called an SSL certificate) to verify its identity when a client attempts to connect to the server. By default, the Cisco IPICS server provides a self-signed certificate, which a client typically rejects. To prevent a client from rejecting this certificate, take one of the of the actions that Table 1-1 describes. Table 1-1 Methods for Preventing a Client from Rejecting the Cisco IPICS Server Self-Signed Certificate Method Replace the Cisco IPICS server self-signed certificate with a certificate that is signed by a well-known certificate authority (CA), such as VeriSign or a local CA in your organization. Remarks For additional information, see the Installing Third Party Certificates on the Cisco IPICS Server section in Cisco IPICS Server Installation and Upgrade Guide. 1-7

API Logging Chapter 1 Table 1-1 Methods for Preventing a Client from Rejecting the Cisco IPICS Server Self-Signed Certificate (continued) Method When using a Java client, configure the SSL libraries for your clients to trust the self-signed certificate by using the Java keytool to import the certificate into the client truststore. If you are using a client other than Java, configure the SSL libraries for your clients to trust the self-signed certificate. Modify the way in which your client code validates certificate trust chains. Remarks Procedure: 1. Use SSH to log in to the Cisco IPICS server as the root user. 2. Enter the following command: cd /opt/cisco/ipics/security 3. Download the self-signed certificate named server.cert.pem to the client system. 4. Enter the following command. Replace name with a unique name for the alias, replace certificate_file that you downloaded to the client, and replace path with the path to the client keystore: keytool -import -alias name -file certificate_file -keystore path You may be able to copy the self-signed certificate to a special directory on the client system. See your library documentation for detailed information. Some languages provide configurable SSL files that let you change the default certificate validation behavior. A client verifies its identity with a user name and password that are sent to the server by the client application. API Logging The Cisco IPICS server logs all web service invocations. Entries include the date and time of the invocation, the API function that was used, and the status of the response. This information is maintained in the Cisco IPICS log file. For more information about the log file, see Cisco IPICS Administration Guide. 1-8