Cognos SDK Guide by BI Centre can be purchased from PayPal.

You will have your own functional Cognos 8 SDK web solution that has been tailored to be scalable and flexible in order to adapt to your unique business requirements and solution architecture.


Monday, November 24, 2008

SDK - SSO for Series 7 gateway namespace using CSharp

using System;
using System.Collections;
using System.Web.Services;
using cognosdotnet_2_0;


namespace SetCredential
{

///
/// Summary description for Class1.
///

class SetCredential
{
private cognosdotnet_2_0.CognosReportNetBinding oCrn = null;

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

public SetCredential(string endPoint)
{
oCrn = new CognosReportNetBinding();
oCrn.Url = endPoint;
oCrn.Credentials= System.Net.CredentialCache.DefaultCredentials;
}


//
// get a list of the packages for the logged in user
//
public void getPackageList()
{
try
{
baseClass [] objInMyFolders = oCrn.query("//package",
props, new sort[]{}, new queryOptions());

int temp = 1; // If you've made it to here, SSO is working. Examine objInMyFolders to see the packages
}
catch (Exception e)
{
Console.Write("\n" +e.GetBaseException());

}
}

///
/// The main entry point for the application.
///

[STAThread]
static void Main(string[] args)
{
String endPoint = "http://localhost/c84GA/cgi-bin/cognos.cgi";
SetCredential packageList = new SetCredential(endPoint);
packageList.getPackageList();
}
}
}