Document wsdl create

Do you want to create a native client or integrate with third party applications: webservices are the solution.

Moderator: car031

Locked
Xerion94
Posts: 2
Joined: Tue Apr 26, 2016 4:52 pm

Document wsdl create

Post by Xerion94 » Tue Apr 26, 2016 5:22 pm

Hi everyone, i'm new to SOAP and logicalDoc. I'm trying to make a java progect that use wsdl schemas to connect, make checkins, updates, and creations of new documents.

I'm using Eclipse with some web services client (Document, Auth, Folder).

I mean that I'm not using the logicalDoc Api (webesrvices, core) that gives the possibility of using a DocumentClient but I'm using DocumentServiceProxy.

The problem is that when I create a new document nothing happens: no Errors are thrown, but no document is created.

java code:

String host = "https://MYLogicalDoc:8080/services";

DocumentServiceProxy documentClient = new DocumentServiceProxy(host + "/Document");
AuthServiceProxy auth = new AuthServiceProxy(host + "/Auth");

String sid = auth.login(userName, password);

WsDocument document = new WsDocument();
document.setComment(comment);
document.setTitle("Title");
document.setFileName("name");
document.setLanguage("en");
document.setType("txt");
document.setFolderId(folder.getId());//id where I need the folder

WsDocumentHolder docHolder= new WsDocumentHolder(document);

InputStream stream = new FileInputStream("path\to\my\file.txt");

byte[] bytesArray= new byte[(int) file.length()];

documentClient.create(sid, docHolder, bytesArray);


The create function is supposed to create a new document, isn't it?
Something strange happens because when I try to create a document with a name it doesn't get created (if I search with a given id (or name) I don't get the document, so supposely it doesn't exist) but if I try to create a document with the same name from another java project (works with Logicaldoc api (webesrvices, core) -fully working-tested) the document is created but to the name given is added a round square with a number (e.g (2)) like there actually exist a document with that name.

agaspa
Posts: 514
Joined: Tue Apr 20, 2010 8:24 am

Re: Document wsdl create

Post by agaspa » Tue May 03, 2016 10:39 am

Hi Xerion94,
try to catch the exceptions
and to initialize the variable "comments"

Also maybe the issue is on the https self signed certificate,
try to use directly the http variant:

Code: Select all

String host = "http://MYLogicalDoc:8080/services";

Xerion94
Posts: 2
Joined: Tue Apr 26, 2016 4:52 pm

Re: Document wsdl create

Post by Xerion94 » Wed May 04, 2016 3:39 pm

Thank you very much but I already resolved it: when I started with the tutorials I used the logicaldoc api then make a pgm that use only wsdl schema. Using the wsdl as I did, the creation of a document is a little different and the doc need a publish method to be called so you can see the actual document on Logicldoc otherwise I think that the document is saved but because of not being published you can't neither find the document (to actually publish it) nor to delete it.
I think that there is a very lack of documentation abuot all methods if you work withuot logicaldoc api. Moreover even in the Logicaldoc api sometimes you are not so sure of what are you doing because sometimes there aren't any kind of explanation of themethods. By the way the tutorials with the logicaldoc api are very well formed, of course is required to who is working on them to pay attention cause mistakes can be easily make.
Sorry for the not-perfect english

agaspa
Posts: 514
Joined: Tue Apr 20, 2010 8:24 am

Re: Document wsdl create

Post by agaspa » Thu May 05, 2016 8:19 am

Ok Xerion,
I'm glad you've solved.
I will pass your suggestions to those involved in the documentation.
If you need further help we are at your disposal.

Note: Speaking of Web-services, with the next release of LogicalDOC (LogicalDOC 7.5) there will be some significant innovations and changes in usage.
In fact, we are implementing a whole new set of REST methods

Br
Alex

Locked

Who is online

Users browsing this forum: Bing [Bot] and 1 guest