• okmDocumentClient.createSimple New document size is 0

  • 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.
 #28065  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.
 #28072  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
 #28079  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
 #28081  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.

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.