Page 1 of 1
okmDocumentClient.createSimple New document size is 0
PostPosted:Sun Mar 09, 2014 4:30 pm
by cpted
Hi,
im using the webservices within a .net visual Basic application.
It works fine with the downloaded community Version.
Whe I compile OpenKM and deploy the new war file and try to use the create-method, it sets the size of the new document to 0.
Same happens when i use the CreateSimple, CreateAssync methods.
I compiled the Versions 6.2.5 and 6.2.6 in Eclipse and in jboss, both on Windows and on Ubuntu.
Actually im using the
The file is created properly and can be shown in as preview in a browser with the web client but the size is 0.
Re: okmDocumentClient.createSimple New document size is 0
PostPosted:Mon Mar 10, 2014 8:26 am
by jllort
Write here your .net code to see what are you doing. Appears some error in catalina.log when you're executing it ?
Re: okmDocumentClient.createSimple New document size is 0
PostPosted:Mon Mar 10, 2014 10:28 pm
by cpted
Hi jllort,
thank you for answering.
No errors in catalina.log only one new row:
2014-03-03 00:56:00,285 [ main] INFO org.apache.catalina.startup.Catalina - Server startup in 10781 ms
2014-03-03 00:58:14,689 [http-bio-0.0.0.0-8080-exec-7] INFO com.openkm.vernum.VersionNumerationFactory - VersionNumerationAdapter: com.openkm.vernum.MajorMinorVersionNumerationAdapter
And here the code:
Private Sub ButtonCreate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCreate.Click
Try
'selecting the file from the windows filesystem
Dim ret As DialogResult = Me.OpenFileDialog1.ShowDialog()
Dim filepath As String = Me.OpenFileDialog1.FileName()
'filling the byte array
Dim fis As IO.FileStream = New IO.FileStream(filepath, IO.FileMode.Open)
Dim content(fis.Length) As Byte
Dim size As Integer = fis.Read(content, 0, fis.Length)
'creating the new document
Dim filename = Split(filepath, "\")(UBound(Split(filepath, "\")))
Dim docpath As String = "/okm:root/" & filename
Dim okmDocumentClient As New OKMDocumentService.OKMDocumentClient
Dim newDoc As OKMDocumentService.document = okmDocumentClient.createSimple(token, docpath, content)
'following messagebox returns o for the size and in the web client the size is shown as 0
MsgBox("Path: " & newDoc.path & ", Author: " & newDoc.author.ToString & ", Size: " & newDoc.actualVersion.size)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Re: okmDocumentClient.createSimple New document size is 0
PostPosted:Tue Mar 11, 2014 11:27 am
by jllort
Are you using OpenKM SDK for .net ? or you've generated your own WS ?
Re: okmDocumentClient.createSimple New document size is 0
PostPosted:Tue Mar 11, 2014 10:31 pm
by cpted
Hi jllort,
I didn't use the OKM .NET SDK, I referenced each Service (OKMAuth, OKMFolder, OKMDocument etc.) as a new webservice in my project.
It worked very well with the original TomCat package running on Ubuntu 12.04.
Then i checked out openkm from sourceforge in Eclipse, compiled it and replaced the original war in the tomcat webapps with the new one from my target folder.
Everything works, but not the create.
Thank you for mentioning the SDK !
Greetings
cpted
Re: okmDocumentClient.createSimple New document size is 0
PostPosted:Wed Mar 12, 2014 10:30 am
by jllort
I suggest use SDK for .NET and you'll be free of the problems caused by webservices API changes. We made some changes on WS to upload documents more efficiently. Be sure you're generating using WS on same openkm version otherside you can get problems there. With SDK we try to help developer between API changes to get it transparent from your side.
Re: okmDocumentClient.createSimple New document size is 0
PostPosted:Wed Mar 19, 2014 7:13 am
by online100
the way they have been managing, storing and saving their important documents at your place of work and wanted to use much easier and quicker system.
Re: okmDocumentClient.createSimple New document size is 0
PostPosted:Sat Mar 22, 2014 8:55 am
by pavila
The SDK is quite simple to use. What is the problem?