Hi, I am using synapse 1.1 binary distribution and want to use groovy script to mediate. I couldn't find any example in this distribution on groovy mediation.
I googled a bit and found the following link on script mediation in Synapse. http://wso2.org/project/esb/java/1.0/docs/ESB_Samples.html#ExtensionMediators It has sample 500 which shows the script mediator support etc (synapse 1.1 don't have sample 500). Now I have some queries: 1. Which synapse distribution has groovy examples ("hello world" etc) / support? 2. Should I compile "service.groovy" to bytecode and put somewhere in synapse? 3. Referring to the folowing link http://wso2.org/project/esb/java/1.0/docs/ESB_Samples.html#ExtensionMediators I tried to add the following lines in an existing sample <localEntry key="groovyScript" src="file:repository/conf/sample/resources/script/service.groovy"/> <script language="groovy" key="groovyScript"/> where service.groovy has the following lines: def name='World'; println "Hello $name!" Now I tried to start a synapse configuration and I got the following exception: ....... ....... 2008-01-24 20:40:17,811 [10.140.15.208-petris-chandra] [main] INFO XMLConfigura tionBuilder Generating the Synapse configuration model by parsing the XML config uration 2008-01-24 20:40:17,874 [10.140.15.208-petris-chandra] [main] DEBUG Configuratio nFactoryAndSerializerFinder getConfiguration({http://ws.apache.org/ns/synapse}de finitions) 2008-01-24 20:40:17,936 [10.140.15.208-petris-chandra] [main] ERROR SynapseConfi gurationBuilder Could not initialize Synapse : com.ctc.wstx.exc.WstxUnexpectedCh arException: Unexpected character 'd' (code 100) in prolog; expected '<' at [row,col {unknown-source}]: [1,1] org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: U nexpected character 'd' (code 100) in prolog; expected '<' at [row,col {unknown-source}]: [1,1] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.jav a:239) at org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMD ocumentImpl.java:130) ....... ....... Please help me so that groovy script can mediate. Thanks Bhatt -- View this message in context: http://www.nabble.com/how-to-use-groovy-script-to-mediate-in-synapse-tp15066002p15066002.html Sent from the Synapse - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
