000032489 - How to search for records using the RSA Archer Web Services API method called ExecuteSearch

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 3Show Document
  • View in full screen mode

Article Content

Article Number000032489
Applies ToRSA Product Set: Archer
RSA Version/Condition: 5.x and higher
Platform: Windows
ResolutionIf you are using a newer version of Archer, there’s a real easy way to build the <SearchReport> XML string by using the GetSearchOptions or GetSearchOptionsByGuid methods in the Search web service:
  1. In the web UI, create a Report with the fields to display, filter, sorting, etc and then save the Report.
  2. Get the Report Id (integer) or GUID.
  3. Call the GetSearchOptions or GetSearchOptionsByGuid method.
  4. The results will contain the <SearchReport>.
Get all records for a Module and display specific fields.
<SearchReport>
  <PageSize>250</PageSize>
  <DisplayFields>
    <DisplayField name="Tracking Id">13864</DisplayField>
    <DisplayField name="Name">13867</DisplayField>
    <DisplayField name="Description">13868</DisplayField>
  </DisplayFields>
  <Criteria>
    <ModuleCriteria>
      <Module name="My App">397</Module>
    </ModuleCriteria>
  </Criteria>
</SearchReport>

Search records using a Keyword and display specific fields.  This is similar to a Quick Search.
<SearchReport>
  <PageSize>250</PageSize>
  <DisplayFields>
    <DisplayField name="Tracking Id">13864</DisplayField>
    <DisplayField name="Name">13867</DisplayField>
    <DisplayField name="Description">13868</DisplayField>
  </DisplayFields>
  <Criteria>
    <Keywords>whatever</Keywords>
    <ModuleCriteria>
      <Module name="My App">397</Module>
      <IsKeywordModule>true</IsKeywordModule>
    </ModuleCriteria>
  </Criteria>
</SearchReport>

Search records using a text filter where a Text field equals a value and display specific fields.
<SearchReport>
  <PageSize>250</PageSize>
  <DisplayFields>
    <DisplayField name="Tracking Id">13864</DisplayField>
    <DisplayField name="Name">13867</DisplayField>
  </DisplayFields>
  <Criteria>
    <Filter>
      <Conditions>
        <TextFilterCondition>
          <Operator>Equals</Operator>
          <Field>13867</Field>
          <Value>HTML Test</Value>
        </TextFilterCondition>
      </Conditions>
    </Filter>
    <ModuleCriteria>
      <Module name="My App">397</Module>
    </ModuleCriteria>
  </Criteria>
</SearchReport>

Search records using a numeric filter where a Tracking Id field equals a value and display specific fields.
<SearchReport>
  <PageSize>250</PageSize>
  <DisplayFields>
    <DisplayField name="Tracking Id">13864</DisplayField>
    <DisplayField name="Name">13867</DisplayField>
  </DisplayFields>
  <Criteria>
    <Filter>
      <Conditions>
        <NumericFilterCondition>
          <Operator>Equals</Operator>
          <Field name="Tracking Id">13864</Field>
          <Value>205511</Value>
        </NumericFilterCondition>
      </Conditions>
    </Filter>
    <ModuleCriteria>
      <Module name="My App">397</Module>
    </ModuleCriteria>
  </Criteria>
</SearchReport>

Search records using a date filter where a Date field equals a value and display specific fields.
<SearchReport>
  <PageSize>250</PageSize>
  <DisplayFields>
    <DisplayField name="Tracking Id">13864</DisplayField>
    <DisplayField name="Name">13867</DisplayField>
    <DisplayField name="My Date">13888</DisplayField>
  </DisplayFields>
  <Criteria>
    <Filter>
      <Conditions>
        <DateComparisonFilterCondition>
          <Operator>Equals</Operator>
          <Field name="My Date">13888</Field>
          <Value>07/14/2016</Value>
          <TimeZoneId>Central Standard Time</TimeZoneId>
        </DateComparisonFilterCondition>
      </Conditions>
    </Filter>
    <ModuleCriteria>
      <Module name="My App">397</Module>
    </ModuleCriteria>
  </Criteria>
</SearchReport>

Search records using a date range filter where a Date field is between two values and display specific fields.
<SearchReport>
  <PageSize>250</PageSize>
  <DisplayFields>
    <DisplayField name="Tracking Id">13864</DisplayField>
    <DisplayField name="Name">13867</DisplayField>
    <DisplayField name="My Date">13888</DisplayField>
  </DisplayFields>
  <Criteria>
    <Filter>
      <Conditions>
        <DateRangeFilterCondition>
          <Operator>Between</Operator>
          <Field name="My Date">13888</Field>
          <BeginValue>1/1/2016</BeginValue>
          <EndValue>9/28/2016</EndValue>
        </DateRangeFilterCondition>
      </Conditions>
    </Filter>
    <ModuleCriteria>
      <Module name="My App">397</Module>
    </ModuleCriteria>
  </Criteria>
</SearchReport>

Search for records and display specific fields from a Sub-Form and Module.
<SearchReport>
  <PageSize>250</PageSize>
  <ContainedDisplayFields>
    <ContainedDisplayField>
      <Field name="Subform Field Id from App">13895</Field>
      <DisplayFields>
        <DisplayField name="Text Field Id from Subform">13893</DisplayField>
      </DisplayFields>
    </ContainedDisplayField>
  </ContainedDisplayFields>
  <DisplayFields>
    <DisplayField name="Name">13867</DisplayField>
    <DisplayField name="Subform Field Id from App">13895</DisplayField>
  </DisplayFields>
  <Criteria>
    <ModuleCriteria>
      <Module name="My App">397</Module>
    </ModuleCriteria>
  </Criteria>
</SearchReport>

Search for records using a complex filter with Advanced Operator Logic and display specific fields.
<SearchReport>
  <PageSize>250</PageSize>
  <DisplayFields>
    <DisplayField name="Tracking Id">13864</DisplayField>
    <DisplayField name="Name">13867</DisplayField>
    <DisplayField name="Description">13868</DisplayField>
  </DisplayFields>
  <Criteria>
    <ModuleCriteria>
      <Module name="My App">397</Module>
    </ModuleCriteria>
    <Filter>
      <Conditions>
        <TextFilterCondition>
          <Operator>Contains</Operator>
          <Field name="Name">13867</Field>
          <Value>something</Value>
        </TextFilterCondition>
        <TextFilterCondition>
          <Operator>Contains</Operator>
          <Field name="Name">13867</Field>
          <Value>whatever</Value>
        </TextFilterCondition>
      </Conditions>
      <OperatorLogic>1 OR 2</OperatorLogic>
    </Filter>
  </Criteria>
</SearchReport>

When using SOAP and the Web Services method has parameters requiring XML data, you may need to enclose the XML string within CDATA.  
Check out KB 12781
When calling a Web Service API method using SOAP the following occurs: The remote server returned an error: (400) Bad Request.
SOAP sample call:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://archer-tech.com/webservices/">
   <soapenv:Header/>
   <soapenv:Body>
      <web:ExecuteSearch>
         <web:sessionToken>FC4F5CE48C350344C950CDF963694CA2</web:sessionToken>
         <web:searchOptions>
            <![CDATA[
                    <SearchReport>
                      <PageSize>250</PageSize>
                      <DisplayFields>
                        <DisplayField name="Tracking Id">13864</DisplayField>
                        <DisplayField name="Name">13867</DisplayField>
                        <DisplayField name="Description">13868</DisplayField>
                      </DisplayFields>
                      <Criteria>
                        <ModuleCriteria>
                          <Module name="My App">397</Module>
                        </ModuleCriteria>
                      </Criteria>
                    </SearchReport>
            ]]>
         </web:searchOptions>
         <web:pageNumber>1</web:pageNumber>
      </web:ExecuteSearch>
   </soapenv:Body>
</soapenv:Envelope>



 

Attachments

    Outcomes