Example Using Search Service

List service XML files essentially contain a <list> element as the document root, and will not be described further. Search service XML files are very similar to those for page services. Here is an example illustrating the differences:


<?xml version="1.0"?>
<!-- XML Java/Tuxedo mapping CIPCACCS
  Automatically generated by makeXMLMap Sat Nov 10 09:08:30 2001
  Source copybooks: CICCACCS CICCACCH -->
<search name="ACCT"
        service="CILCACCS"
        size="300">
   <searchHeader lastIndex="ACCT_COLL_CNT"
                 actionFlag="SRCH_ACTION_FLG"
                 searchByFlag="SEARCH_BY_FLG">

The <search> element is the root of the document, and contains a <searchHeader> and <listBody>. The <search> element is similar to the <list> element described above, and includes name, service, and size attributes. The <searchHeader> includes the "lastIndex" attribute, which gives the name of the field holding the number of returned elements, "actionFlag" which names the field containing the search action flag, and "searchByFlag" which names the field holding the search "mode". The <searchHeader> further contains singleton fields describing search criteria. These are adorned with extra attributes describing whether they are distinguished criteria that should always be populated from the search client (optional, defaults to "false"), and a criteria group designation.


      <string name="ACCT_ID"
              size="10"
              isCriteriaExtract="true"
              criteriaGroup="MN"/>
      <string name="ENTITY_NAME"
              size="50"
              criteriaGroup="AL"/>
   </searchHeader>

The <listBody> was described previously, and describes the structure of the elements matching the search criteria. In addition, the "isReturn" attribute describes fields that should be returned as the result data when a particular result row is selected (optional, defaults to "false").


   <listBody>
      <row actionFlag="ROW_ACTION_FLG">
         <string name="ACCT_ID"
                 size="10"
                 isReturn="true"/>
         <string name="ENTITY_NAME"
                 size="50"/>
         <string name="ACCT_REL_DESCR"
                 size="50"/>
         <string name="NAME_TYPE_FLG"
                 size="4"/>
      </row>
   </listBody>
</search>