Page 1 of 1

OKMDocument.create throws exception

PostPosted:Thu Mar 27, 2014 6:01 pm
by Supriya
HI

When i run OKMDocument.create(token, doc, FileUtil.readFile(localFileName));

it throws exception as "cafebabe-cafe-babe-cafe-babecafebabe"

Why is this exception
Code: Select all
ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateServerCertificate);
webservice = OKMWebServiceFactory.getInstance(host, user, password, OKMWebServiceFactory.COMMUNITY_6_0);
token = webservice.login();           
authService = new OKMAuth(host);             
documentService = new com.openkm.ws.community.ws60.OKMDocument(host);           
token = token = authService.login("okmAdmin", "admin");
// create document
com.openkm.ws.community.ws60.document doc = new com.openkm.ws.community.ws60.document();          
doc.path = @"\okm:root\";
string localFileName = @"hosts.txt";            
documentService.create(token, doc, FileUtil.readFile(localFileName));               
authService.logout(token);
webservice.logout(token);
Thanks
Supriya

Re: OKMDocument.create throws exception

PostPosted:Sat Mar 29, 2014 7:46 am
by jllort
Here I see two errors doc.path = @"\okm:root\";
First this is not a path, path should be something like "/okm:root/document.txt"
Second wrong use of \ really the character to indicate path is /

I think with this changes you'll get solved