The example helps somehow. I used XmlSlurper() to retrieve specific tags from
the inMessage.bodyText (see below), but I'm not sure if this is a good
practice.
<sm:activationSpec componentName="transformThisResp"
service="test:transformThisResp" endpoint="endpoint">
<sm:component>
<bean
class="org.apache.servicemix.components.groovy.GroovyComponent">
<property name="scriptText">
<value><![CDATA[
def node = new XmlSlurper().parseText(inMessage.bodyText)
println "identity: " + node.endpointReference.filter.identity
// Create output message with variable from input
outMessage.bodyText = """
<soapenv:Envelope
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">
<soapenv:Body>
<submitThisResponse xmlns=\"http://www.my.com/xsd/\">
<return>$node.endpointReference.filter.identity</return>
</submitThisResponse>
</soapenv:Body>
</soapenv:Envelope>
"""
]]></value>
</property>
</bean>
</sm:component>
</sm:activationSpec>
--
View this message in context:
http://www.nabble.com/Groovy-example-t1692744.html#a4695318
Sent from the ServiceMix - User forum at Nabble.com.