java - Using JBoss ESB, how do I get multiple objects out of smooks and use them as params to an ejb? -
this part of jboss-esb.xml file:
<action name="hotelavailrq_to_hotelavailrequest" class="org.jboss.soa.esb.smooks.smooksaction"> <property name="smooksconfig" value="requestconverters/hotelavailrq_to_hotelavailrequest.xml" /> <property name="resulttype" value="java" /> <!-- <property name="javaresultbeanid" value="hotel" /> --> <!-- <property name="set-payload-location" value="map" /> --> <property name="mappedcontextobjects" value="hotel,daterange" /> <property name="reportpath" value="c:\documents , settings\barrowj\esb-workspace\esb\smooks-in-report.html" /> </action> <action name="print-result" class="org.jboss.soa.esb.actions.systemprintln" > <property name="message" value="read" /> <property name="printfull" value="true" /> </action> <action name="availabilitycall" class="org.jboss.soa.esb.actions.ejbprocessor"> <property name="ejb3" value="true" /> <property name="jndi-name" value="hotelbooking/remote" /> <property name="initial-context-factory" value="org.jnp.interfaces.namingcontextfactory" /> <property name="provider-url" value="jnp://localhost:1099" /> <property name="method" value="availability" /> <property name="ejb-params"> <arg0 type="model.domain.hotel">map.hotel</arg0> <arg1 type="model.domain.value_objects.daterange">body.map.daterange</arg1> <arg2 type="model.domain.value_objects.roomrequest">roomrequest</arg2> <arg3 type="model.domain.rateplanlist">rateplanlist</arg3> <arg4 type="model.domain.amenitylist">amenitylist</arg4> <arg5 type="model.domain.types.money">minimumrate</arg5> <arg6 type="model.domain.types.money">maximumrate</arg6> <arg7 type="model.domain.partner">partner</arg7> </property> </action>
the smooks call returns
body: [ objects: {org.jboss.soa.esb.message.defaultentry= { daterange=daterange [ thru=2010-03-24, from=2010-03-23], roomrequest=roomrequest [list=[guestinfo [count=1, age=null]], numberofrooms=1], ptime=null, guestinfo=guestinfo [count=1, age=null], puuid=null, partner=partner [partnerid=bukuser], hotel=hotel [id=61044, name=null, chaincode=bw, roomtypes=[], maxstay=p30d, bookings=[], rateplans=[]], guestinfolist=[guestinfo [count=1, age=null]]}, smooksexecutioncontext={}} ]
so, need map daterange, roomrequest, guestinfo , other ejb params ejb call. there way this?
the documentation indicates can, doesn't how map value out of context map in xml.
so problem turns out interaction between smooks action , ejb action. smooks returns hashmap of stuff. puts hashmap inside message.body of esb. which, in turn hashmap.
the ejb action looking message.getbody().get("name"), when should looking message.getbody().get("smooksresults").get("name"). there no way tell ejb action in there.
the solution change ejb action can in smooks results hashmap.
Comments
Post a Comment