Purchase your Section 508 Compliance Support guide now!

Purchase your Section 508 Compliance Support guide now!

Cognos SDK example of getting a deployment package details

Hello, some people have been looking for information on how to access a deployment package by using the Cognos SDK.  Here is an example to that will capture a specified deployment package.  Don't forget that you can set the location of your deployment packages from within Cognos Configuration.
 
The 'Cognos SDK Guide by BI Centre' also discusses the Exception class that is used in this code in more detail.
 
 
 
public
baseClass[] getExportItems(string strNamespaceId)

{

//string export = "CAMID(\"" + strNamespaceId + "\")//Export";

string export = "/adminFolder/importDeployment[@name=''MY DEPLOYMENT PACKAGE"]";

propEnum[] props = new propEnum[] { propEnum.deployedObjectDefaultName, propEnum.defaultName, propEnum.searchPath };

baseClass[] exportObjects = new baseClass[] { };

searchPathMultipleObject spMulti = new searchPathMultipleObject();

spMulti.Value = export;

try

{

exportObjects = cmService.query(spMulti, props,

new sort[] { }, new queryOptions());

}

catch (SoapException exSoap)

{

SoapExceptionHandler objEx = new SoapExceptionHandler(exSoap);

MessageBox.Show(objEx.Details + objEx.Message + objEx.ErrorCode + objEx.Severity);

}

return exportObjects;

}