Hey StackOverflow users,
I'm currently working on a SOA Project. As an Application Server I use JBoss 5.1 with JBoss ESB 4.11 deployed.
I try to implement a Web Service which recieves SOAP Messages from Clients and send responses as SOAP messages as well.
When a SOAP message request is recieved by this Web Service I'm using Smooks to transform this message into Java Objects so i can process the request.
When im done processing, I want to transform Java Objects to XML (a SOAP reply), again with Smooks.
I'm stuck on the transformation from Java to XML.
My Action Chain in the jboss-esb.xml
file looks like this:
<services>
<service name="myWS" description="A Service" category="WS">
<listeners>
<jms-listener name="myListener" busidref="myChannel"/>
</listeners>
<actions mep="RequestResponse" inXsd="in.xsd" outXsd="out.xsd">
<!-- Transform incomming SOAP Message into JavaBean objects -->
<action name="xml2java-transform" class="org.jboss.soa.esb.smooks.SmooksAction">
<property name="smooksConfig" value="/smooks/smooks-config-soap2java.xml"/>
<property name="resultType" value="JAVA" />
</action>
<action name="processRequest" class="example.soa.ProcessRequest" process="process">
<property name="config" value="val"/>
</action>
<!-- Transform outgoing JavaBean objects into SOAP Message -->
<action name="java2xml-transform" class="org.jboss.soa.esb.smooks.SmooksAction">
<property name="smooksConfig" value="/smooks/smooks-config-java2soap.xml"/>
<property name="reportPath" value="/smooks/report.html"/>
<property name="resultType" value="STRING" />
</action>
</actions>
</service>
</services>
My smooksConfig
of the second SmooksAction looks like this:
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd"
xmlns:core="http://www.milyn.org/xsd/smooks/smooks-core-1.4.xsd">
<core:filterSettings type="SAX" defaultSerialization="false"/>
<resource-config selector="example.JavaObjectMessage">
<resource>org.milyn.delivery.DomModelCreator</resource>
</resource-config>
<ftl:freemarker applyOnElement="example.JavaObjectMessage">
<!--<ftl:template>/freemarker/acknowledge.flt</ftl:template> -->
<ftl:template>
<!--
<sg:Message xmlns:sg="urn:http://example">
<sg:MessageType>${.vars[example.JavaObjectMessage].messageType}</sg:MessageType>
</sg:Message >
-->
</ftl:template>
</ftl:freemarker>
</smooks-resource-list>
After the processRequest
Action is done processing the incomming request it will attatch the example.JavaObjectMessage
class to the esb message. So the second SmooksAction will have access to this Object.
My question is: how can i access the attributes of the 'example.JavaObjectMessage' in the smooksConfig
? And to what does the applyOnElement
refer to in the flt:tamplate
section?
I already read the Smooks User Guide and in the JBoss Community I posted this question too.
I appreciate any help!
Regards