cancel
Showing results for 
Search instead for 
Did you mean: 

Custom webservice/webscript to upload files

unknown-user
Champ on-the-rise
Champ on-the-rise
Hi,

We have 3-4 client applications written in Java/.Net connecting to our Alfresco Repository through out of the box WebService API's. There is a need now to control the way the files/folders are uploaded to Alfresco, basically we wanted the folders/content to be stored in a hierarchical folder structure. In order to isolate the client applications from the changes due to this, we need to give a custom service through which they can upload and query content. The custom service implementation will make sure that the files are stored in the desired structure.

Whats the best way to implement this custom service? Can we create a custom axis webservice that makes use of various Repository Services (ContentService, FileFolderService etc) and package it along with Alfresco? Has anyone done this before?

I know webscripts can be used for fileupload but how will we manage the metadata updation along with the content upload? Our client applications are standalone applications and they dont run in a web context.

Can we extend any of the out of the box webservices? like, providing a wrapper?

Thanks in advance
1 REPLY 1

openpj
Elite Collaborator
Elite Collaborator
Whats the best way to implement this custom service? Can we create a custom axis webservice that makes use of various Repository Services (ContentService, FileFolderService etc) and package it along with Alfresco? Has anyone done this before?
The best way to implement upload services is to implement a custom WebScript that allows you to write your own code using the Alfresco Javascript API or the Alfresco Java API. In this way your custom business logic are written using a low-level and complete API of Alfresco.

The upload WebScript will be your own extended REST API of Alfresco and for an upload service this means that you can stream your binaries file using HTTP protocol.

The basic SOAP service available in the Alfresco Web Services API can't be used for large binaries because otherwise you will get OOME for your client application. This depends on the specific Apache Axis 1.4 implementation.

If you need to use SOAP with the Alfresco Web Services API you can use the ContentService or you can use the RepositoryService adding a CML component named CMLWriteContent to set the binary as one the fields of the Java object. Remember that all the binaries in the SOAP API will be encoded in Base64 inside the SOAP message (!!!!) that's why it can't be used for large files.

Hope this helps.