cancel
Showing results for 
Search instead for 
Did you mean: 

Create a new WebService

ppagno
Champ in-the-making
Champ in-the-making
Hi guys,
I'm a new user in Alfreso and I'd need to create a custom web service.

How could I create this ws?
Is there a guide to follow?

I know how create a web service with axis, but how can I deploy the ws inside Alfresco?

Thanks in advance
ppagno
4 REPLIES 4

pmonks
Star Contributor
Star Contributor
Creating a new web service is going to require diving into the Alfresco code and extending the existing server-side SOAP API.  A simpler option from an implementation perspective would be to consider using one or more Web Scripts (http://wiki.alfresco.com/wiki/Web_Scripts) instead, although that does mean you'll be using a REST style API rather than a SOAP based API (which in most cases is a good thing, but obviously depends somewhat on what the client side technology is capable of).

sergio
Champ in-the-making
Champ in-the-making
I all.

Just one year ago I started with a project based on Alfresco 2.0 that has been customized in many ways. The project has been involving a heavy custimization of Alfresco (2.0 and now 2.1). Among these customizations, one consists of creating a new custom web service exposed such as other Alfresco web services (you can find a list of Alfresco WSs in the \alfresco\wsdl folder). The strategy used at that moment was to create a Java class based on the Alfresco core java classes. One of these classes is used for generating a web service (I used the automatic tool of Eclipse for generating a wsdl from a Java class). Using the wsdl I created a java stub for being used by a web service client.

Later, I had to modify something into Alfresco in order to expose correctly the new custom web service:
1. the new file XXX.wsdl was copied into the \alfresco\wsdl folder;
2. the content of the new server-config.wsdd (generated by Eclipse while generating the wsdl) was copied and pasted into the server-config.wsdd Alfresco file;
3. The new custom Java library was copied into the \lib\ folder for being available to Alfresco.

As a result, a new custom web service is available.

This method works well but tha main limit is that we had to modify something into Alfresco instead of using any extension mechanism. I think this task could have been done better, sure. But this was the solution I found more than one year ago.

I think that the Web Scripts mechanism is very useful even if too limited at the moment. If you want to manage in more details documents and implements custom behaviours, I think the best solution is going into the Java code.

All the best,

Sergio

pmonks
Star Contributor
Star Contributor
Can you give us some more details on what you've found limiting about Web Scripts?

Cheers,
Peter

raju_myadam
Champ in-the-making
Champ in-the-making
Sergio,

I have a similar requirement to expose the custom web service which will JCR API of Alfresco. Could you please share some more details on this like files you have modified in Alfresco, etc?

Regards,
Raju