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();
}
}
}