## Document wsdl create

Do you want to create a native client or integrate with third party applications: webservices are the solution.
Xerion94
Posts: 2
Joined: Tue Apr 26, 2016 4:52 pm

### Document wsdl create

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");

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: 485
Joined: Tue Apr 20, 2010 8:24 am

### Re: Document wsdl create

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

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: 485
Joined: Tue Apr 20, 2010 8:24 am

Ok Xerion,