Hi,

first of all, there is a tutorial here:

http://doc.nuxeo.org/xwiki/bin/view/Main/RestletTutorial

But you may have already seen it.

I've been told there is a bug with file uploads, which seems to be precisely what you are trying to do. I can't tell you more at this point.

We also have a newer REST API described here:

http://doc.nuxeo.org/xwiki/bin/view/Main/WebEngineTutorial

Regarding RMI and SOAP: there are examples on how to use RMI in Nuxeo Samples (http://hg.nuxeo.org/addons/nuxeo-samples/) or in the Nuxeo Shell.

SOAP is also supported, because that's what we are using to implement the NX WSS client.

The concerned developers can probably point you to more precise doc or samples.

  S.

On Mar 17, 2009, at 9:24 PM, Ilya Sterin wrote:

I'm using nuxeo-http-client 5.2.  Compiled it with JSE 5.  Here is my
sample code...


NuxeoServer nxServer = new NuxeoServer("http://127.0.0.1:8080/nuxeo";);
nxServer.setBasicAuthentication("Administrator", "Administrator");

List<String> pathParams = Arrays.asList(
       "default", "609d14c0-8382-4769-9e36-441a6bcab66a",
       "testing.xml", "upload");
FileInputStream istream = new FileInputStream(new
File("/Users/ilya/Desktop/ids.txt"));
Representation res = nxServer.doRestletPostCall(pathParams, null, istream);

System.err.println("RESPONSE: " + res.getText());


The response that I get is...

<?xml version="1.0" encoding="UTF-8"?>
<error message="the request was rejected because its size is unknown"
class ="org.apache.commons.fileupload.FileUploadBase.UnknownSizeException"/>


I was also trying to just use curl in order to invoke the request...

curl -u Administrator:Administrator -F "title=testing&[email protected]"
http://localhost:8080/nuxeo/restAPI/default/609d14c0-8382-4769-9e36-441a6bcab66a/testing.pdf/upload

This works and uploads the file, but it names the file  file.pdf vs.
testing.pdf specified.  I guess I'm trying to get more info on the
REST api.  First it seems rather that it's not very restful at least
from my trials below (I hope I'm really wrong about this).  I think I
should be able to upload files using their respective content type,
not having to use multipart/form-data.  But i'd be happy to use any
http based api at this point, if you can point me towards more
comprehensive documentation and/or examples.

Also, is http/REST api a stable/well supported API, or would you
recommend using other APIs (RMI, SOAP)?

Thanks.
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

--
Stefane Fermigier, Founder and Chairman, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
Web: http://www.nuxeo.com/ - Tel: +33 1 40 33 79 87
New: follow me on Twitter: http://twitter.com/sfermigier
New: join the Nuxeo Group on LinkedIn: http://www.linkedin.com/groups?gid=43314

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to