Introduction

When executing a SmartBox SmartObject GetList method where there are no records in the corresponding table or there are records, but no matching records returned from the search input, an Invalid archive type error occurs instead of no records.

Error Scenario

Note: The circumstances described in this article are one scenario under which this issue may, or is known to occur. The description is intended to be specific to the scenario described and does not take into account all possible scenarios or circumstances.

To reproduce this error:

using System;
using SourceCode.Serialization;
 
namespace ReproArchiveX
{
    class Program
    {
        // 42000 causes error
        const int REPEAT = 42000;
        static void Main(string[] args)
        {
            try
            {
                ArchiveX archiveX = new ArchiveX();
                archiveX.AddString(new string('1', REPEAT));
 
                Console.WriteLine("ArchiveX Position: {0}", archiveX.Position);
                archiveX.AddByteArray(null);
 
                ArchiveX createArchiveX = new ArchiveX(archiveX.Buffer);
                createArchiveX.GetString();
                createArchiveX.GetByteArray();
            }
            catch (Exception ex)
            {
                Console.WriteLine("ERROR: {0}", ex.Message);
            }
            finally
            {
                Console.Write("Press any key to exit ...");
                Console.ReadKey();
            }
        }
    }
}

Error Message

Invalid Archive Type

Error Resolution

This Hotfix is contained within the latest K2 Update. Install the update package to resolve the error.