On Sat, 2006-10-21 at 15:48 +0100, ant elder wrote:
> I started a script mediator based on BSF in the scratch area:
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/BSF/
Very cool :).
> The basic function works now, there's a simple Synapse config file and
> associate _javascript_ program demonstrating it which mediates the
> messages used by the Synapse StockquoteClient sample so it uses the
> xmethods stockquote service:
>
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/BSF/repository/conf/sample/synapse_sample_script2.xml
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/BSF/repository/conf/sample/xmethodsStockquote.js
Why is this wrapped in a CDATA?
Thats as currently AFAICT the registry only supports XML, see the lookup method in https://svn.apache.org/repos/asf/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/registry/url/SimpleURLRegistry.java
I'll raise a JIRA so we can look at enhancing it to support things other than XML docs.
> This uses the Synapse registry and stores the script in a property
> which is different than the _javascript_ mediator which embeds the
> script in a CDATA within the Synapse config XML file. There's an
> example of theis at:
> https://svn.apache.org/repos/asf/incubator/synapse/trunk/scratch/ant/BSF/repository/conf/sample/synapse_sample_js.xml.
>
> I think i like the registry/property approach better as the embedded
> approach gets a bit hard to read. I guess it could support both but
> maybe that just makes things even more complicated. Does anyone else
> have a preference either way?
I agree- but we should allow one to define a mediator inline .. rather
than to execute an inlined mediator.
I'm not sure what you mean by define inline rather than execute an inlined, could you explain a bit more?
...ant
