The executeDomainQuery Operation

The executeDomainQuery operation takes these parameters:

domainUri - a string containing the path to the Domain on the server, for example /domains/John/ExpenseDomain.
queryStr - a string containing the Domain query composed of fields and a filter expression (see below for the syntax).
localeStr - a string giving the user locale, for example en, en_US, or es_ES_Traditional_WIN.
dateFormatStr - a string giving the date format desired in date fields, for example MM/dd/yyyy or h:mm a.

Be sure the format has date and time portions if you expect to have both date and time fields, for example yyyy.MM.dd G 'at' HH:mm:ss z

The query string is composed of the following elements that create a syntax for the Domain query:

<query> - encapsulates the whole query.
<queryFields> - contains a sequence of <queryField> elements. The order of fields will be preserved in the results.
<queryField id="<fullyQualifiedID>" /> - an empty element where <fullyQualifiedID> gives the unique identifier of an item you want to appear as a column in the results. The identifier must be fully qualified, which means it includes the identifiers of the set and super-sets to which the item belongs. The fully qualified identifier is similar to the path of the item in the Domain, using a period (.) to separate each set identifier.
<queryFilterString> - the filter string for the query uses an application-specific syntax called Domain Expression Language (DomEL).

The following example shows a filter string that must match two values:

<query>
  <queryFields>
    <queryField id="expense_join_store.ej_store_store_city" />
    <queryField id="expense_join_store.ej_store_store_country" />
    <queryField id="expense_join_store.ej_store_store_name" />
    <queryField id="expense_join_store.ej_store_store_state" />
    <queryField id="expense_join_store.ej_store_store_street_address" />
  </queryFields>
  <queryFilterString>expense_join_store.ej_store_store_country == 'USA' and 
    expense_join_store.ej_store_store_state == 'CA'</queryFilterString>
</query> 

Note that when the query string appears in the SOAP example below, special characters such as < and > are converted to their corresponding character entities, &lt; and &gt; respectively.

The executeDomainQuery operation returns results in the following objects:

ResultSetData. Encapsulates the results of the Domain query. It contains column names and rows of data:
names. Array of column names in the result set. These names match the order and items in the query fields.
data. An array of data rows.
DataRow. Represents a record and contains values for each column in a row:
data. An array of strings, one for the value in each column, in the same order as the names array.

Note that all values are given in string format.

The following example shows the full SOAP request for an executeDomainQuery operation on a sample Domain:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <ns1:executeDomainQuery soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/
      encoding/" xmlns:ns1="http://www.jasperforge.org/jasperserver/ws">
      <domainUri xsi:type="xsd:string">/Domains/examples/SampleDomain</domainUri>
      <queryStr xsi:type="xsd:string">&lt;query&gt;  &lt;queryFields&gt;    &lt;queryField id=&quot;expense_join_account.ej_account_account_description&quot;/&gt;&lt;queryField id=&quot;expense_join_account.ej_expense_fact_account_id&quot; /&gt;    &lt;queryField id=&quot;expense_join_account.ej_account_account_parent&quot; /&gt;    &lt;queryField id=&quot;expense_join_account.ej_account_account_rollup&quot; /&gt;    &lt;queryField id=&quot;expense_join_account.ej_account_account_type&quot; /&gt;    &lt;queryField id=&quot;expense_join_account.ej_account_Custom_Members&quot; /&gt;    &lt;queryField id=&quot;expense_join.ej_expense_fact_amount&quot; /&gt;    &lt;queryField id=&quot;expense_join.ej_expense_fact_exp_date&quot; /&gt; &lt;queryField id=&quot;expense_join_store.ej_store_store_type&quot; /&gt;&lt;queryField id=&quot;expense_join_store.ej_store_store_street_address&quot; /&gt; &lt;queryField id=&quot;expense_join_store.ej_store_store_city&quot; /&gt; &lt;queryField id=&quot;expense_join_store.ej_store_store_state&quot; /&gt;&lt;queryField id=&quot;expense_join_store.ej_store_store_postal_code&quot; /&gt; &lt;queryField id=&quot;expense_join_store.ej_store_store_country&quot; /&gt; &lt;queryFields&gt;  &lt;queryFilterString&gt;expense_join_account.ej_account_account_description == 'Marketing'&lt;/queryFilterString&gt;&lt;/query&gt;</queryStr><br /><br /><br /><br />
      <localeStr xsi:type="xsd:string">US</localeStr>
      <dateFormatStr xsi:type="xsd:string">MM/dd/yyyy</dateFormatStr>
    </ns1:executeDomainQuery>
  </soapenv:Body>
</soapenv:Envelope>

The response to the request contains the current values in the specified Domain:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <ns1:executeDomainQueryResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/
      soap/encoding/" xmlns:ns1="http://www.jasperforge.org/jasperserver/ws">
      <executeDomainQueryReturn xsi:type="ns1:ResultSetData">
        <names soapenc:arrayType="xsd:string[31]" xsi:type="soapenc:Array" 
          xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
          <names xsi:type="xsd:string">expense_join_account.ej_account_account_
            description/>
          <names xsi:type="xsd:string">expense_join_account.ej_expense_fact_
            account_id/>
          <names xsi:type="xsd:string">expense_join_account.ej_account_account_parent/>
          <names xsi:type="xsd:string">expense_join_account.ej_account_account_rollup/>
          <names xsi:type="xsd:string">expense_join_account.ej_account_account_type/>
          <names xsi:type="xsd:string">expense_join_account.ej_account_Custom_Members/>
          <names xsi:type="xsd:string">expense_join.ej_expense_fact_amount/>
          <names xsi:type="xsd:string">expense_join_store.ej_store_store_type/>
          <names xsi:type="xsd:string">expense_join_store.ej_store_store_street_
            address/>
          <names xsi:type="xsd:string">expense_join_store.ej_store_store_city/>
          <names xsi:type="xsd:string">expense_join_store.ej_store_store_state/>
          <names xsi:type="xsd:string">expense_join_store.ej_store_store_postal_code/>
        </names>
        <data soapenc:arrayType="ns1:DataRow[600]" xsi:type="soapenc:Array" 
          xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
          <data xsi:type="ns1:DataRow">
            <data soapenc:arrayType="xsd:string[31]" xsi:type="soapenc:Array">
              <data xsi:type="xsd:string">Marketing</data>
              <data xsi:type="xsd:string">4300</data>
              <data xsi:type="xsd:string">4000</data>
              <data xsi:type="xsd:string">+</data>
              <data xsi:type="xsd:string">Expense</data>
              <data xsi:type="xsd:string" xsi:nil="true"/>
              <data xsi:type="xsd:string">1884.0000</data>
              <data xsi:type="xsd:string">01/01/1997</data>
              <data xsi:type="xsd:string">HeadQuarters</data>
              <data xsi:type="xsd:string">1 Alameda Way</data>
              <data xsi:type="xsd:string">Alameda</data>
              <data xsi:type="xsd:string">CA</data>
              <data xsi:type="xsd:string">94502</data>
              <data xsi:type="xsd:string">USA</data>
            </data>
          </data>
...
        </data>
      </executeDomainQueryReturn>
    </ns1:executeDomainQueryResponse>
  </soapenv:Body>
</soapenv:Envelope>
Version: 
Feedback