Refer to the SmooksResourceConfiguration, AbstractBeanPopulator and StringTemplateContentDeliveryUnitCreator docs when reading these configurations.
For the request (trans-request.cdrl):
<?xml version="1.0"?> <!DOCTYPE smooks-resource-list PUBLIC "-//MILYN//DTD SMOOKS 1.0//EN" "http://www.milyn.org/dtd/smooksres-list-1.0.dtd"> <smooks-resource-list default-useragent="shipping-request"> <!-- Configure the TrackingNumber bean creation and population... --> <smooks-resource selector="trackingNumber" path="org.milyn.javabean.ProcessingPhaseBeanPopulator"> <!-- create and bind the bean instance --> <param name="beanId">trackingNumber</param> <param name="beanClass">org.milyn.templating.soapshipping.TrackingNumber</param> </smooks-resource> <smooks-resource selector="trackingNumber shipperID" path="org.milyn.javabean.ProcessingPhaseBeanPopulator"> <!-- extract shipperID text and set on the trackingNumber bean --> <param name="beanId">trackingNumber</param> <param name="setterName">setShipperID</param> </smooks-resource> <smooks-resource selector="trackingNumber shipmentNumber" path="org.milyn.javabean.ProcessingPhaseBeanPopulator"> <!-- extract shipmentNumber text and set on the trackingNumber bean --> <param name="beanId">trackingNumber</param> <param name="setterName">setShipmentNumber</param> </smooks-resource> <!-- Use a StringTemplate template to perform the transformation. We're transforming the "trackingNumber" element... --> <smooks-resource selector="trackingNumber" path="/org/milyn/templating/soapshipping/st/TrackingNumberIn.st" /> </smooks-resource-list>
For the response (trans-response.cdrl):
<?xml version="1.0"?> <!DOCTYPE smooks-resource-list PUBLIC "-//MILYN//DTD SMOOKS 1.0//EN" "http://www.milyn.org/dtd/smooksres-list-1.0.dtd"> <smooks-resource-list default-useragent="shipping-response"> <!-- Configure the History bean creation and population... --> <smooks-resource selector="history" path="org.milyn.javabean.ProcessingPhaseBeanPopulator"> <!-- create and bind the bean instance --> <param name="beanId">history</param> <param name="beanClass">org.milyn.templating.soapshipping.History</param> <!-- extract the tracking numbers text and set on the bean --> <param name="setterName">setTrackingNumbers</param> </smooks-resource> <!-- Use a StringTemplate template to perform the transformation. We're transforming the "history" element... --> <smooks-resource selector="history" path="/org/milyn/templating/soapshipping/st/HistoryTrans.st" /> </smooks-resource-list>
Labels