Runtime components : Core components : Web services access : Accessing Web services : Defining the Web services mapper : Mapping a keyed collection to a JavaBean
  
Mapping a keyed collection to a JavaBean
The following example is a definition of a Web services mapper that is designed to map a kColl from to a JavaBean from a Web service data model. A kColl can be mapped to a JavaBean because they have the same data structure. Only data that share the same structure can be mapped to each other.
<!-- Context to JavaBean -->
<fmtDef id="fmt_Context2JavaBean">
  <wsMapperConverter isPrimitive="false" javaClass="com.ibm.btt.test.Bean">
    <mapper from="beanKColl" to="*" byReference="true"/>
  </wsMapperConverter>
</fmtDef>
A kColl can also be mapped to a JavaBean by mapping the individual fields of the kColl to the individual fields of the JavaBean.
<!-- Context to JavaBean -->
<fmtDef id="fmt_Context2JavaBean">
  <wsMapperConverter isPrimitive="false" javaClass="com.ibm.btt.test.Bean">
    <mapper from="beanKColl.field1" to="name" byReference="true"/>
    <mapper from="beanKColl.field2" to="age" byReference="true"/>
    <mapper from="beanKColl.field3" to="sex" byReference="true"/>
  </wsMapperConverter>
</fmtDef>
Go up to
Defining the Web services mapper