2 Replies Latest reply on Apr 8, 2013 10:01 AM by Jeff DeLong

    Smooks transform problems - Setting data object 'null'

    Jeff DeLong Master

      When I run the following transformation:

       

      <smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"

                            xmlns:core="http://www.milyn.org/xsd/smooks/smooks-core-1.4.xsd"

                        xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.4.xsd">

               

         <core:namespaces>

              <core:namespace prefix="pol" uri="http://www.example.org/policyQuote"/>

          </core:namespaces>

       

       

        <jb:bean beanId="policyQuote" class="org.acme.insurance.PolicyQuote" createOnElement="/pol:policyQuote">

          <jb:value property="requestDate" data="/pol:policyQuote/pol:receivePolicyQuote/pol:requestDate" decoder="Date">

            <jb:decodeParam name="format">yyyy-MM-dd</jb:decodeParam>

          </jb:value>

          <jb:value property="policyType" data="/pol:policyQuote/pol:receivePolicyQuote/pol:policyQuoteInfo/pol:policyType" />

          <jb:value property="vehicleYear" data="/pol:policyQuote/pol:receivePolicyQuote/pol:policyQuoteInfo/pol:vehicleYear"  /> 

          <jb:value property="age" data="/pol:policyQuote/pol:receivePolicyQuote/pol:policyQuoteInfo/pol:age" />

          <jb:value property="creditScore" data="/pol:policyQuote/pol:receivePolicyQuote/pol:policyQuoteInfo/pol:creditScore" />

          <jb:value property="dlNumber" data="/pol:policyQuote/pol:receivePolicyQuote/pol:policyQuoteInfo/pol:dlNumber" />

          <jb:value property="driverName" data="/pol:policyQuote/pol:receivePolicyQuote/pol:policyQuoteInfo/pol:driverName" />

          <jb:value property="numberOfAccidents" data="/pol:policyQuote/pol:receivePolicyQuote/pol:policyQuoteInfo/pol:numberOfAccidents" />

          <jb:value property="numberOfTickets" data="/pol:policyQuote/pol:receivePolicyQuote/pol:policyQuoteInfo/pol:numberOfTickets" />

          <jb:value property="ssn" data="/pol:policyQuote/pol:receivePolicyQuote/pol:policyQuoteInfo/pol:ssn" />

        </jb:bean>

       

      </smooks-resource-list>

       

      I see the following in the log (I have set org.milyn logging to debug)

       

       

      ------- Begin Message Trace -------

      Service -> {urn:org.acme.insurance:PolicyQuoteProcessService:0.0.1-SNAPSHOT}PolicyQuoteProcessService

      Operation -> receivePolicyQuote

      Phase -> IN

      State -> OK

      Exchange Context ->

      Message Context ->

          org.switchyard.messageId : dec13419-6b9a-438e-9a32-c9ed42715dec

          Accept : text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

          org.switchyard.soap.messageName : receivePolicyQuoteRequest

          org.switchyard.contentType : {http://www.example.org/policyQuote}policyQuote

      Message Content ->

      <?xml version="1.0" encoding="UTF-8"?><pol:policyQuote xmlns:pol="http://www.example.org/policyQuote">

               <pol:receivePolicyQuote>

                    <pol:requestDate>2010-01-01</pol:requestDate>

                  <pol:task>receivePolicyQuote</pol:task>

                  <pol:policyQuoteInfo>

                     <pol:policyType>AUTO</pol:policyType>

                     <pol:vehicleYear>2004</pol:vehicleYear>

                     <pol:driverName>Bob</pol:driverName>

                     <pol:ssn>22345678</pol:ssn>

                     <pol:dlNumber>12345</pol:dlNumber>

                     <pol:age>20</pol:age>

                     <pol:numberOfAccidents>1</pol:numberOfAccidents>

                     <pol:numberOfTickets>0</pol:numberOfTickets>

                     <pol:creditScore>0</pol:creditScore>

                     <pol:price>0</pol:price>

                  </pol:policyQuoteInfo>

               </pol:receivePolicyQuote>

            </pol:policyQuote>

      ------ End Message Trace -------

      15:03:08,068 DEBUG [org.milyn.delivery.sax.SmooksSAXFilter] (http--127.0.0.1-8080-1) DOMSource converted to a StringSource.

      15:03:08,069 DEBUG [org.milyn.javabean.BeanInstanceCreator] (http--127.0.0.1-8080-1) Bean [policyQuote] instance created.

      15:03:08,070 DEBUG [org.milyn.javabean.BeanInstancePopulator] (http--127.0.0.1-8080-1) Setting data object 'null' (java.util.Date) on target bean 'policyQuote'.

      15:03:08,070 DEBUG [org.milyn.javabean.BeanInstancePopulator] (http--127.0.0.1-8080-1) Setting data object 'null' (java.lang.String) on target bean 'policyQuote'.

      15:03:08,070 DEBUG [org.milyn.javabean.BeanInstancePopulator] (http--127.0.0.1-8080-1) Setting data object 'null' (java.lang.Integer) on target bean 'policyQuote'.

      15:03:08,071 DEBUG [org.milyn.javabean.BeanInstancePopulator] (http--127.0.0.1-8080-1) Setting data object 'null' (java.lang.String) on target bean 'policyQuote'.

      15:03:08,071 DEBUG [org.milyn.javabean.BeanInstancePopulator] (http--127.0.0.1-8080-1) Setting data object 'null' (java.lang.String) on target bean 'policyQuote'.

      15:03:08,072 DEBUG [org.milyn.javabean.BeanInstancePopulator] (http--127.0.0.1-8080-1) Setting data object 'null' (java.lang.String) on target bean 'policyQuote'.

      15:03:08,072 DEBUG [org.milyn.javabean.BeanInstancePopulator] (http--127.0.0.1-8080-1) Setting data object 'null' (java.lang.Integer) on target bean 'policyQuote'.

      15:03:08,072 DEBUG [org.milyn.javabean.BeanInstancePopulator] (http--127.0.0.1-8080-1) Setting data object 'null' (java.lang.Integer) on target bean 'policyQuote'.

      15:03:08,073 DEBUG [org.milyn.javabean.BeanInstancePopulator] (http--127.0.0.1-8080-1) Setting data object 'null' (java.lang.Integer) on target bean 'policyQuote'.

      15:03:08,073 DEBUG [org.milyn.javabean.BeanInstancePopulator] (http--127.0.0.1-8080-1) Setting data object 'null' (java.lang.Integer) on target bean 'policyQuote'.

       

       

      The bean is created but the field are all null.