Cognos SDK初体验一.pdf
文本预览下载声明
Cognos SDK 初体验一 -- by Bill, 2014
一、场景:在目前允许匿名登录的Cognos 10.2.1 BI 服务器上测试SDK
二、SDK 测试程序部署
SDK 测试应用程序作为stand alone Java 应用程序部署,作为客户端,利用Cognos
SDK 提供的JAR 包,访问远端独立的BI 服务器。Cognos SDK 提供的JAR 包内部
通过Web Service 方式访问BI 服务器。
三、步骤
0、准备工作:安装Cognos BI Server,安装Cognos SDK
1、创建Java 项目,设置依赖包-拷贝所有在cognos\c10_64\sdk\java \lib 下的jar 包
注:依赖包位于SDK 已安装路径C:\IBM\cognos\c10_64\sdk\java \lib 下
2 、创建一个简单的测试程序
package test;
import .URL;
import com.cognos.developer.schemas.bibus._3.BaseClass;
import com.cognos.developer.schemas.bibus._3.ContentManagerService_PortType;
1
import
com.cognos.developer.schemas.bibus._3.ContentManagerService_ServiceLocator;
import com.cognos.developer.schemas.bibus._3.PropEnum;
import com.cognos.developer.schemas.bibus._3.QueryOptions;
import com.cognos.developer.schemas.bibus._3.SearchPathMultipleObject;
import com.cognos.developer.schemas.bibus._3.Sort;
public class SimpleTest1 {
private static String dispatcherURL =
http://COGDEV:9300/p2pd/servlet/dispatch;
private ContentManagerService_PortType cmService = null;
public static void main(String[] args) {
SimpleTest1 test = new SimpleTest1();
// Step 1: Connect to the Cognos services
test.connectToCognos(dispatcherURL );
// Step 2: Logon to Cognos
//mainClass.logonToCognos(nameSpaceID, userName, password);
// Step 3: Execute tasks
test.executeTasks();
// Step 4: Logoff from Cognos
//mainClass.logoffFromCognos();
}
// Step 1: Connect to the Cognos services
private void connectToCognos(String dispatcherURL) {
ContentManagerService_ServiceLocator cmServiceLocator = new
ContentManagerService_ServiceLocator();
try {
URL url = new URL(dispatcherURL);
cmServi
显示全部