ESB - Webservice - Smooks Mapping
andre-s-2010 Sep 23, 2011 3:42 AMHey guys,
actually i am playing around with jboss esb and smooks.
I've created an ESB service that is exposed as a webservice.
Inside the ESB Service the request should be mapped via Smooks to the response
and send back to the webservice caller. Problem now is that i dont get the smooks mapping
running. :-(
Here is my esb config which is working fine.
<?xml version="1.0"?>
<jbossesb parameterReloadSecs="5"
xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd">
<services>
<service category="ChaabpServices"
description="EsbService with operations for DemandProcess"
invmScope="GLOBAL" name="EsbDemandProcess">
<actions inXsd="/request.xsd" mep="RequestResponse"
outXsd="/response.xsd" requestLocation="DemandProcessRequest"
responseLocation="DemandProcessResponse" validate="true" webservice="true">
<action class="de.tigerbytes.esb.demandprocess.DemandProcessActions"
name="GetTasksForAmbulancePartner" process="getTasks4AmbulancePartner"/>
<action class="org.jboss.soa.esb.smooks.SmooksAction" name="TransformInput">
<property name="smooksConfig" value="/META-INF/smooks-config.xml"/>
<property name="get-payload-location" value="DemandProcessRequest"/>
<property name="set-payload-location" value="DemandProcessResponse"/>
<property name="resultType" value="JAVA"/>
</action>
<action class="de.tigerbytes.esb.demandprocess.DemandProcessActions"
name="PrintMessageBody" process="checkTransformation"/>
</actions>
</service>
</services>
</jbossesb>
Here is my Smooks Config
<?xml version="1.0" encoding="UTF-8"?><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:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
<params>
<param name="inputType">input.java</param>
<param name="default.serialization.on">true</param>
<param name="stream.filter.type">SAX</param>
<param name="input.java" type="input.type.actived">de.tigerbytes.esb.demandprocess.DemandProcessRequest</param>
</params>
<jb:bean beanId="DemandProcessResponse" class="de.tigerbytes.esb.demandprocess.DemandProcessResponse" createOnElement="de.tigerbytes.esb.demandprocess.DemandProcessRequest">
<jb:value data="/de.tigerbytes.esb.demandprocess.DemandProcessRequest/processName" property="success"/>
</jb:bean>
</smooks-resource-list>
As you can see i tryed to use an object mapping, because the request could be found as an object in the Message object.
Is that correct?
I also tryed XML 2 Object and XML 2 XML Mappings, but nothing works.
May be somebody could help.
THX