示例#1
0
        private void button3_Click(object sender, EventArgs e)
        {
            AddLog("Passive cycle - Read with offset - Start");
            IO.Swagger.Api.ReceptionInvoicesNotificationsApi ReceptionInvoicesNotificationsApi = new IO.Swagger.Api.ReceptionInvoicesNotificationsApi(_urlWebApiInvoice);

            DateTime?data = DateTime.Now.AddDays(-90).ToUniversalTime();
            var      receptionOffsetSubscribeResponse     = ReceptionInvoicesNotificationsApi.ReceptionOffsetSubscribe(AooIdentifier, UoIdentifier, new IO.Swagger.Model.ReceptionSubscribeOffsetRequest(null, data), _authToken);
            var      receptionOffsetNotificationsResponse = ReceptionInvoicesNotificationsApi.GetReceptionOffsetNotifications(AooIdentifier, UoIdentifier, receptionOffsetSubscribeResponse.SubscriptionUID, 10, _authToken);

            foreach (var notification in receptionOffsetNotificationsResponse.Notifications)
            {
                MenagePassiveEvent(notification);
            }
            ReceptionInvoicesNotificationsApi.ReceptionOffsetUnsubscribe(AooIdentifier, UoIdentifier, receptionOffsetSubscribeResponse.SubscriptionUID, _authToken);
            AddLog("Passive cycle - Read with offset - End");
        }
示例#2
0
        private void button4_Click(object sender, EventArgs e)
        {
            AddLog("Passive cycle - Read without offset - Start");

            IO.Swagger.Api.ReceptionInvoicesNotificationsApi ReceptionInvoicesNotificationsApi = new IO.Swagger.Api.ReceptionInvoicesNotificationsApi(_urlWebApiInvoice);

            //I create a new subscription without parameters. The IX.FE server know when I have downloaded the notifications in the past
            var receptionSubscribeResponse = ReceptionInvoicesNotificationsApi.ReceptionSubscribe(AooIdentifier, UoIdentifier, _authToken);
            //I download from IX FE the next list of top 10 events
            var receptionNotificationsResponse = ReceptionInvoicesNotificationsApi.GetReceptionNotifications(AooIdentifier, UoIdentifier, receptionSubscribeResponse.SubscriptionUID, 10, _authToken);

            foreach (var notification in receptionNotificationsResponse.Notifications)
            {
                //foreac event I must manage the event's detail
                MenagePassiveEvent(notification);
            }
            //Now I call the ACK to inform the IX FE server that I have readed correctply all the events dopwnloaded
            ReceptionInvoicesNotificationsApi.ReceptionSubscriptionAck(AooIdentifier, UoIdentifier, receptionSubscribeResponse.SubscriptionUID, receptionNotificationsResponse.AckUID, _authToken);
            //Now I call the Commit to close the Subscription
            ReceptionInvoicesNotificationsApi.ReceptionSubscriptionCommit(AooIdentifier, UoIdentifier, receptionSubscribeResponse.SubscriptionUID, _authToken);
            AddLog("Passive cycle - Read without offset - End");
        }