cancel
Showing results for 
Search instead for 
Did you mean: 

XML-RPC ?

sacco
Champ in-the-making
Champ in-the-making
I need to integrate some bits of Alfresco functionality with a legacy application which can make (and reply to) XML-RPC calls.  Seems to me the easiest way would be to keep most of the logic in Alfresco and have it send back a preformatted chunk of page, possibly from either a template or a Web script, but it also shouldn't be difficult to expose funtionality more directly, given that it's already exposed as Web Services.

Does anybody have any experience of this / helpful clues to offer?
2 REPLIES 2

pmonks
Star Contributor
Star Contributor
This is exactly the kind of thing web scripts (http://wiki.alfresco.com/wiki/Web_Scripts) were designed to do, so I wouldn't even look at other ways of doing this.  One tip would be to take a look at E4X (http://en.wikipedia.org/wiki/E4X) - it makes it significantly easier to work with XML from within Javascript (including Rhino, the Javascript interpreter embedded within Alfresco).

Note that to enable E4X within current builds of Alfresco (up to and including 2.1.x and possibly also the impending 2.2 release), you need to follow the instructions at http://issues.alfresco.com/browse/AR-1720.  A fix for this problem has been checked in, but hasn't surfaced in an official release yet.

sacco
Champ in-the-making
Champ in-the-making
Thanks for the reply: the Web scripts certainly look useful (in fact I'm
already aiming to use them for some other purposes).  However, I have
two queries:

1)  
Many of the Java interfaces are already exposed as Web Services,
which means that most of the work necessary to expose them directly
as XML-RPC has already been done.  In fact this possibility is even
mentioned in the Implementation notes on the Wiki:
http://wiki.alfresco.com/wiki/Web_Services_Implementation

It therefore seems as though it might be simpler to do this directly,
rather than effectively to implement XML-RPC higher up in the
JavaScript layer?


2)
The documentation on the Wiki of Web Scripts suggests that they
receive their arguments from a POST request as a parsed  mapping
of name/value pairs;  however, a call to an XML-RPC method transmits
it's payload as a single XML structure, so it seems that the script would
not be able to receive its arguments for subsequent processing with E4X.

Is this the case, or have I misundertood something here?


If this is the case, then we will have to intervene at the Java level
anyway (though I suppose this could be limited to putting the payload
somewhere that the script can see it).


If this isn't the case and the script can see the payload, then I suppose a
viable approach would be to prototype an XML-RPC server toolkit in
ECMAScript using E4x, and then subsequently move the implementation
to be supplied by a Web Script Runtime.  The XML-RPC spec is so short,
that it couldn't  take too long (I hope!).


Suggestions?
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.