• SDK for .NET - Error: La longitud no puede ser inferior a cero

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #53860  by greynozo
 
Buenas tardes,

Me encuentro en la tarea de crear un desarrollo capaz de interactuar con el Web Service OpenKM de un cliente. La idea es programar un servicio capaz de crear carpetas y subir documentación.
Al momento, estoy intentando utilizar las herramientas que provee OKM para .Net, es decir SDK for .NET. He intentado con las versiones 1.3 y 1.4..
Al intentar realizar tareas sencillas, como obtener versión o crear carpetas, termino obteniendo el mismo error:
"La longitud no puede ser inferior a cero. Nombre del parámetro: length"

Mi código es el siguiente:
Code: Select all
try
            {
                string hs = uriHelper.getUri(HOST, uriHelper.FOLDER_CREATE);
                OKMWebservice ws = OKMWebservicesFactory.newInstance(hs, USER, PASS);
                
                Folder folder = new Folder();
                folder.path = path;
               
                Folder fld = ws.createFolder(folder);

                Console.WriteLine(fld.path);
                Console.ReadLine();

                Console.WriteLine(path);
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Status: " + ex.Message);
                Console.Read();
            }
Muchas gracias de antemano.
 #53862  by jorge.seifert
 
Tengo el mismo problema :

SDK for .NET 1.4.0
Tomé el ejemplo https://docs.openkm.com/kcenter/view/sd ... eateFolder

Status: FolderImpl (createFolder)
La longitud no puede ser inferior a cero.
Nombre del parámetro: length

System.ArgumentOutOfRangeException: La longitud no puede ser inferior a cero.
Nombre del parámetro: length
en System.String.Substring(Int32 startIndex, Int32 length)
en com.openkm.sdk4csharp.impl.FolderImpl.createFolder(Folder fld)
 #53945  by pherrera
 
Hola greynozo ,

Efectivametne tu URL estaba incorrecta el valor del host debe ser por ejemplo:
String host = "http://localhost:8080/OpenKM";
OKMWebservice ws = OKMWebservicesFactory.newInstance("http://localhost:8080/OpenKM", "user", "123456");

y la version del SDK 1.4 se corresponde con la version 6.3.11 de tu OpenKM.

Saludos,

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.