这是我的 jboss-esb.xml 文件的一部分:
<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 and 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>
smooks 电话返回
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={}} ]
因此,我需要将 dateRange、roomRequest、guestInfo 和其他 EJB 参数映射到 EJB 调用。有没有办法做到这一点?
该文档表明您可以,但没有说明如何从 XML 中的上下文映射中获取映射值。