Как получить LastRunTime для отчета с помощью SDK Business Objects Web Services?

Я использую SDK веб-служб Business Objects для доступа к нашим данным Business Objects. Я успешно получил список отчетов и из него нашел LastSuccessfulInstance отчета, который был запущен ранее. Однако я не могу заполнить LastRunTime. Когда я делаю запрос без указанных атрибутов, он возвращается как не установленный, и я получаю тот же результат, когда я запрашиваю этот атрибут, в частности. Я просмотрел сам отчет и экземпляр, и они оба не имеют этой информации. Кто-нибудь знает, где я могу получить его от?

Вот мой код (взломанный из одной из демонстраций SAP):

    var sessConnUrl = serviceUrl + "/session";
    var boConnection = new BusinessObjects.DSWS.Connection(sessConnUrl);
    var boSession = new Session(boConnection);

    // Setup the Enterprise Credentials used to login to the Enterprise System
    var boEnterpriseCredential = new EnterpriseCredential
                                     {
                                         Domain = cmsname,
                                         Login = username,
                                         Password = password,
                                         AuthType = authType
                                     };

    // Login to the Enterprise System and retrieve the SessionInfo
    boSession.Login(boEnterpriseCredential);


    /************************** DISPLAY INBOX OBJECTS *************************/

    // Retrieve the BIPlatform Service so it can be used to add the USER
    var biPlatformUrl = boSession.GetAssociatedServicesURL("BIPlatform");
    var boBiPlatform = BIPlatform.GetInstance(boSession, biPlatformUrl[0]);

    // Specify the query used to retrieve the inbox objects
    // NOTE: Adding a "/" at the end of the query indicates that we want to 
    //       retrieve the all the objects located directly under the inbox.
    //       Without the "/" Path operator, the inbox itself would be returned. 
    const string query = "path://InfoObjects/Root Folder/Reports/";

    // Execute the query and retrieve the reports objects
    var boResponseHolder = boBiPlatform.Get(query, null);
    var boInfoObjects = boResponseHolder.InfoObjects.InfoObject;

    // If the reports contains a list of objects, loop through and display them
    if (boInfoObjects != null) 
    {
        // Go through and display the list of documents
    foreach (var boInfoObject in boInfoObjects)
    {
            var report = boInfoObject as Webi;
            if (report == null)
                continue;

            if (!string.IsNullOrEmpty(report.LastSuccessfulInstanceCUID))
            {
                var instanceQuery = "cuid://<" + report.LastSuccessfulInstanceCUID + ">";
                var instanceResponseHolder = boBiPlatform.Get(instanceQuery, null);
                var instance = instanceResponseHolder.InfoObjects.InfoObject[0];

            }
        }
    }

И report.LastRunTimeSpecified, и instance.LastRunTimeSpecified являются ложными, и оба LastRunTime являются 01\01\0001, но я могу видеть время последнего выполнения в пользовательском интерфейсе Web Intelligence.


person Jackson Pope    schedule 20.01.2011    source источник
comment
Вопрос, этот код написан на c#? потому что это может помочь пометить его как С#. Поскольку кода для бизнес-объектов sdk в С# очень мало   -  person apereira    schedule 30.10.2017
comment
@apereira: Да, это так. Я добавил тег.   -  person Jackson Pope    schedule 31.10.2017


Ответы (1)


С небольшой помощью Теда Уеды из службы поддержки SAP я понял это. Не все свойства заполнены по умолчанию, вам нужно добавить @* к строке запроса, чтобы получить все, т.е. изменить строку:

const string query = "path://InfoObjects/Root Folder/Reports/";

to:

const string query = "path://InfoObjects/Root Folder/Reports/@*";
person Jackson Pope    schedule 27.01.2011