Hi Techies,
--------------------------------Code Start------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Awesomium_Sample
{
using BusinessObjects.DSWS.BIPlatform;
using BusinessObjects.DSWS.Session;
using BusinessObjects.DSWS.QueryService;
using BusinessObjects.DSWS;
using BusinessObjects.DSWS.BIPlatform.Desktop;
using BusinessObjects.DSWS.ReportEngine;
public partial class ViewReport : Form
{
// modify the variables here to reflect your environment
// CMS-specific parameters
private static string CMS_USER = "user";
private static string CMS_USER_PASSWORD = "pwd$";
private static string CMS_NAME = "server:port";
private static string CMS_AUTHENTICATION = "secLDAP";
// Web Service URLs
private static string WS_BASE_URL = "http://server:port/EUBO/dswsbobje/services/";
private static string WS_URL_SESSION = WS_BASE_URL + "Session";
private static string WS_URL_REPORTENGINE = WS_BASE_URL + "reportengine";
private static string WS_URL_BIPLATFORM = WS_BASE_URL + "biplatform";
private static string REPORT_NAME = "Collateral re-use report";
private BIPlatform bipService;
private ReportEngine boRepEng;
private BusinessObjects.DSWS.Session.Session wSession;
public ViewReport()
{
InitializeComponent();
}
private void Logon()
{
wSession = null;
try
{
BusinessObjects.DSWS.Connection boConnection = new BusinessObjects.DSWS.Connection(WS_URL_SESSION);
// login to BusinessObjects Enterprise using web services
Console.WriteLine("Logging into web service...");
EnterpriseCredential credential = new EnterpriseCredential();
credential.Login = CMS_USER;
credential.Password = CMS_USER_PASSWORD;
credential.Domain = CMS_NAME;
credential.AuthType = CMS_AUTHENTICATION;
wSession = new BusinessObjects.DSWS.Session.Session(boConnection);
wSession.Login(credential);
Console.WriteLine("Logged into web service.");
// initialize platform service
boConnection.URL = WS_URL_BIPLATFORM;
bipService = new BIPlatform(boConnection, wSession.ConnectionState);
// initialize report engine service
boConnection.URL = WS_URL_REPORTENGINE;
boRepEng = new ReportEngine(boConnection, wSession.ConnectionState);
}
catch (DSWSException ex)
{
Console.Error.WriteLine(ex);
Console.Error.WriteLine(ex.CauseDetail);
throw;
}
}
private void Logout()
{
if (null != wSession)
{
wSession.Logout();
}
}
private void OpenSampleReport()
{
try
{
Logon();
ResponseHolder reportRH = bipService.Get("path://InfoObjects/Root Folder/Risk IT Admin/**/", null);
InfoObjects infoobjects = reportRH.InfoObjects;
if (infoobjects == null)
{
return;
}
String repID = infoobjects.InfoObject[0].CUID; -----------> why do I always getinfoobjects.InfoObject[0] as null ? ? ? ? ?
where as if we explore infoobjects.Any[0] here we can see the desired value.
}
catch (DSWSException ex)
{
Console.Error.WriteLine(ex);
Console.Error.WriteLine(ex.CauseDetail);
throw;
}
}
}
}
--------------------------------Code End------------------------------
Friends kindly suggest why do I always getinfoobjects.InfoObject[0] as null. Is there something that I am missing or there's any config needed on the cmc side. kindly suggest I am going crazy and not getting any solution.
Kindly find the attached screenshot for more details.
Thanks,
Sunny