cancel
Showing results for 
Search instead for 
Did you mean: 

InfoObjects.InfoObject[0] is null

Former Member
0 Kudos

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 get infoobjects.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 get infoobjects.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

Accepted Solutions (0)

Answers (1)

Answers (1)

DellSC
Active Contributor
0 Kudos

Unlike everything else in .NET, InfoObjects and just about every other collection in the BO SDK uses 1-based indexing.  Try infoobjects.InfoObject[1] instead.

-Dell

Former Member
0 Kudos

Hi Dell,

    Many thanks for a prompt response.

    I have read your comments but the problem is that InfoObjects.infoObject is null, then in that case there is no point in using the index of 0 or 1. But the another strange things is that InfoObjects.Any has the required result.

         Kindly find the attached screenshot for more details on my issue.

         Appreciate your response.

Thanks,

Sunny

0 Kudos

What happens on this line:

wSession.Login(credential);

Does it fail? If so it explains why the object is empty.

Don

Former Member
0 Kudos

Hi Don,

    No it never fails while login. It does login. But the issue is at lines marked in red, as shown above,

infoobjects.InfoObject is always null where as if we check the value of infoobjects.Any  then it shows the required result but in xml form and not in Infoobject form, which is what we Require.


Kindly find the attached screen shot for more details.


Thanks,

Sunny

former_member207665
Active Participant
0 Kudos

Hi Sunny,

Look's like you are going to the Report path in the repository and not trying to find the Report.

You need to concatenate the REPORT_NAME to the path in the code.

Use:

ResponseHolder reportRH = bipService.Get("path://InfoObjects/Root Folder/Risk IT Admin/**/" + REPORT_NAME, null);

Regards,

Vinit

Former Member
0 Kudos

Hi Vinit,

    Thanks for your response. I had even tried used a valid REPORT_NAME, but even that didnt worked. Actually the problem I am facing is that I am getting InfoObjects.InfoObject as Null, whereas InfoObjects.Any has the required value but in some other format which is not of any use to us. I had referred to tonnes and tonnes of examples and samples all of those uses the same kind of code and they even get the value as given below,

InfoObjects.InfoObject[0].CUID.

But when I try the same thing it fails and the reason is that InfoObject.InfoObject itself is NULL then in that case there is no point in going any further and checking for InfoObjects.InfoObject[0] or any other index.

Kindly refer to the attached S/S for more details.

Can you please suggest if I am missing any setting/ plugin. Or any thing need to be done on CMC side??

     Quick Response Appreciated.

Thanks,

Sunny

former_member207665
Active Participant
0 Kudos

Hi Sunny,

Can you try the below code and share your observations, it is a Web Application:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using BusinessObjects.DSWS;

using BusinessObjects.DSWS.BIPlatform;

using BusinessObjects.DSWS.Session;

using BusinessObjects.DSWS.BIPlatform.Constants;

using BusinessObjects.DSWS.BIPlatform.Desktop;

public partial class _Default : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        // Create the URL for the Session Service and instantiate a new Session

        // Service

        string sessConnURL = "http://localhost:8080/dswsbobje/services/session";

        BusinessObjects.DSWS.Connection boConnection = new BusinessObjects.DSWS.Connection(sessConnURL);

        Session boSession = new Session(boConnection);

        // Setup the Enterprise Credentials used to login to the Enterprise System

        EnterpriseCredential boEnterpriseCredential = new EnterpriseCredential();

        //boEnterpriseCredential.Domain = "localhost";

        boEnterpriseCredential.Domain = "BIPW08R2:6400";

        boEnterpriseCredential.Login = "Administrator";

        boEnterpriseCredential.Password = "Password1";

        boEnterpriseCredential.AuthType = "SecEnterprise";

        // Login to the Enterprise System and retrieve the SessionInfo

        SessionInfo boSessionInfo = boSession.Login(boEnterpriseCredential);

        String strSessionID = boSessionInfo.SessionID;

        boConnection.URL = "http://localhost:8080/dswsbobje/services/biplatform";

        BusinessObjects.DSWS.BIPlatform.BIPlatform bipService = new BusinessObjects.DSWS.BIPlatform.BIPlatform(boConnection, boSession.ConnectionState);

        // initialize platform service

        bipService = new BIPlatform(boConnection, boSession.ConnectionState);

        string reportPath = "query://{select * from ci_infoobjects where si_id = 5551}";

        BusinessObjects.DSWS.BIPlatform.ResponseHolder rh = bipService.Get(reportPath, null);

        InfoObjects infoObjects = rh.InfoObjects;

        InfoObject source = infoObjects.InfoObject[0];

    }

}

Replace your Reports SI_ID in the Query.

I would also like to know what version of Business Object is used at your end.

Regards,

Vinit

Former Member
0 Kudos

Hi Vinit,

     As mentioned above, using your code I have taken the s/s for your reference.

     Kindly find the below s/s,

     S/s 1 which shows infoObjects.InfoObject is always NULL,

     S/s 2 which shows infoObjects.Any has the required result but in xml format, which means its getting the result but not in the way how we need (i.e. in the form of InfoObject but instead xml format).

     Kindly suggest on the same.

Thanks,

Sunny

former_member207665
Active Participant
0 Kudos

Hi Sunny,

I'm not able to replicate the issue at my end. I do not get the infoObjects as Null.

Share your observations on the following:

- What king of Report we are trying to access with this application?

- Is the issue with every Report you try to access?

- Are you able to access the issue giving report through CMC or BI LaunchPad with the credentials used in the application?

- What output do you get when you paste http://localhost:8080/dswsbobje/services/session link in a Browser? Share a Screenshot.

- What is the version of BI with Service Pack?

- What version of Client tools are installed on your Development machine?

Regards,

Vinit

0 Kudos

Hi Sunny,

Your SI_ID value of 23 seems wrong, seems like it to low in value.

Where did you get that number from? If you browse your report folder and then click on the object and look at the properties it should give you the SI_ID and GUID.

A number that low is typically a folder ID and it may be empty or you do not have rights to access it.

Try querying for a actual report object and see if that works.

Don

Former Member
0 Kudos

Hi Vinit,

     Many thanks for your prompt response, and also for trying the sample code for me and providing the S/s with the results.

      If you notice carefully and compare your result with mine then there is a major difference or we can say it is exactly opposite in a way that in my S/s InfoObjects.Any has the required value but in xml format and InfoObjects.InfoObject is NULL. Whereas as per your S/s InfoObjects.Any is NULL and you have the required value in InfoObjects.InfoObject.

     So we just wanted to understand the gap due to which I am not able to get the value in "InfoObjects.InfoObject" but getting the value in "InfoObjects.Any" and vice versa in your case.

     It might be worth checking the points you have asked above like BI version, Service pack, etc. I will try to get all the possible answers and revert back to you.

Thanks,

Sunny

Former Member
0 Kudos

HI Vinit,

     Thanks a lot, correct guess.

     It was all due to version mismatch between BO server and the assemblies used by the .Net application.

     For the best result, I have copied the required assemblies from the BO server and got the required result.

     Now I am getting the result similar to how you have provided the S/s.

Thanks,

Sunny