camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From biswajits <>
Subject Camel Groovy Script
Date Tue, 17 Jun 2014 14:40:33 GMT
I am new to camel.
I am trying to parse a xml in "routeContext" using groovy.

here is my xml

        <modifyPassword class-name="User"

i am try to get the "src-dn" from xml and split it to get the "o="
i am trying the following 

<setHeader headerName="org">
  	     util = new RouteUtil();
  	     def body = request.getBody();
  	     response.setHeader("org", util.getOrgFromDN(util.getUserDn())) 
  	     class RouteUtil{
  		def getOrgFromDN(String dn){
  			return dn.split(",")[2].substring(2);
  	        def getUserDn(){
  		       def bodyXml = new XmlParser().parseText(body);
  		       return bodyXml.attribute("src-dn");

is it possible in camel what i am trying in above code?


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message