GetDynamicQuery

Initial Build

2006.02

xWEB

Web Method

Response Type

XML Node

This web method retrieves data from a Query that was built using the netFORUM query feature in iWeb. Queries are available for an xWeb User to run based on Query Security.

This web method returns the results of a Query in an XmlNode format. This is essentially an XML version of the iWeb Query Tool.

In general use, the integrating program may need to call this method once to get a list of all the queries for a particular object, and then a second time to get the response for a specific query. Alternately, if you have a specific query in mind, then you can skip the first step and just run the web method for the particular query.

Parameters

You must pass the combination of szObjectName and szQueryName because this combination ensures uniqueness. The szQueryName cannot be duplicated within the same szObjectName, but the query name may be duplicated with another object.

In other words, you may only have one query called Full Members in the Individual object, but you may have that same query in the Membership object.

  • szObjectName (string). Name of Facade Object. See XWeb:GetFacadeObjectList#Object_Name for more direction on this parameter.
  • szQueryName (string). Leave empty to get list of all queries, or pass the query name of a specific query to get the results for that query.
  • WithDescriptions (string). Leave empty for default behavior. Pass value of "1" if you want column descriptions to be returned instead of column names.
  • currentPage (int). - See #Pagination. This parameter was introduced in 2011.01.

Response

This method returns an XML node, based on the query submitted.

Usage

o.GetDynamicQuery
(szObjectName as string,szQueryName as string,
 WithDescriptions as string) as XmlNode

Sample Request

This is a request to get all the queries for the Individual object. By leaving szQueryName empty, this instructs the web method to return a list of all queries.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Header>
<m:AuthorizationToken xmlns:m="http://www.avectra.com/2005/">
<m:Token>796b4588-b46b-4fe2-9b64-0600c007c700</m:Token>
</m:AuthorizationToken>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<m:GetDynamicQuery xmlns:m="http://www.avectra.com/2005/">
<m:szObjectName>Individual</m:szObjectName>
<m:szQueryName></m:szQueryName>
<m:WithDescriptions></m:WithDescriptions>
</m:GetDynamicQuery>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Sample Response

This is a response to the request above, showing a list of all the queries for the Individual object. You will want to look at the value of que_description as you will need to pass it to szQueryName in a subsequent web method call.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<AuthorizationToken xmlns="http://www.avectra.com/2005/">
<Token>cd81b97c-ecb2-41dc-a277-76c34b161246</Token>
</AuthorizationToken>
<wsa:Action>http://www.avectra.com/2005/GetDynamicQueryResponse</wsa:Action>
<wsa:MessageID>uuid:6c861b8a-1276-4d0d-9aed-973be730d0d4</wsa:MessageID>
<wsa:RelatesTo>uuid:8c38c823-1a26-4af9-9a77-5cc141aba54a</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-6c93e1a5-9fe7-43ee-986d-8e2af63085b2">
<wsu:Created>2006-09-25T19:55:17Z</wsu:Created>
<wsu:Expires>2006-09-25T20:00:17Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<GetDynamicQueryResponse xmlns="http://www.avectra.com/2005/">
<GetDynamicQueryResult>
<Results recordReturn="69">
<Result>
<que_key>b853b382-0296-47fd-af0f-d15d52917acf</que_key>
<que_description>**Missing Congress District</que_description>
</Result>
<Result>
<que_key>1fc5f99f-de4f-4875-ac0c-fb7ef6d9091e</que_key>
<que_description>**Non-Members Receiving Inherited Membership Benefits</que_description>
</Result>
<Result>
<que_key>edd3f074-c9eb-4244-b2ab-144d6a52c5c0</que_key>
<que_description>*normalquery</que_description>
</Result>
<Result>
<que_key>292ba88a-2abd-435d-863e-6c5b147e1fb1</que_key>
<que_description>_Silviu's test</que_description>
</Result>
<Result>
<que_key>7422f6a5-7eb1-4369-b265-ac61c9a84290</que_key>
<que_description>391 records</que_description>
</Result>
<Result>
<que_key>5ef73225-83b6-43b9-855c-93e5f26f0d38</que_key>
<que_description>AliTestSQL</que_description>
</Result>
</Results>
</GetDynamicQueryResult>
</GetDynamicQueryResponse>
</soap:Body>
</soap:Envelope>

Request for Specific Query

This is a request to get the results of a single query, with the query name passed in the szQueryName parameter. You will know the value of szQueryName based on the value of que_description returned in the response example above:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Header>
<m:AuthorizationToken xmlns:m="http://www.avectra.com/2005/">
<m:Token>cd81b97c-ecb2-41dc-a277-76c34b161246</m:Token>
</m:AuthorizationToken>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<m:GetDynamicQuery xmlns:m="http://www.avectra.com/2005/">
<m:szObjectName>Individual</m:szObjectName>
<m:szQueryName>All National Members</m:szQueryName>
<m:WithDescriptions></m:WithDescriptions>
<m:currentPage>1</m:currentPage>
</m:GetDynamicQuery>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response for Specific Query

Response, showing the actual data returned by the query:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<AuthorizationToken xmlns="http://www.avectra.com/2005/">
<Token>7f21c422-b1da-4c6f-92ed-75bd44ca9d07</Token>
</AuthorizationToken>
<wsa:Action>http://www.avectra.com/2005/GetDynamicQueryResponse</wsa:Action>
<wsa:MessageID>uuid:43a3fdf6-feb6-45ac-abc9-001fe742a81a</wsa:MessageID>
<wsa:RelatesTo>uuid:944195cd-e44d-4ce4-8146-021c3a12c06e</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-e57868c2-e8c9-40cc-8547-8cd7c2019a3c">
<wsu:Created>2006-09-25T19:58:41Z</wsu:Created>
<wsu:Expires>2006-09-25T20:03:41Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<GetDynamicQueryResponse xmlns="http://www.avectra.com/2005/">
<GetDynamicQueryResult>
<Results recordReturn="18" pageTotal="1" recordTotal="18">
<Result>
<ind_cst_key>f00353cc-1fa4-40ab-9ff6-008c2603fb21</ind_cst_key>
<ind_first_name>Gabriel</ind_first_name>
<ind_last_name>Reiser</ind_last_name>
<cst_org_name_dn>Avectra, Inc.</cst_org_name_dn>
<cst_eml_address_dn>greiser@avectra.com</cst_eml_address_dn>
<adr_line1>7601 Jones Branch Drive</adr_line1>
<adr_city_state_code>McLean, VA 22102</adr_city_state_code>
</Result>
<Result>
<ind_cst_key>e5d0c114-6ee0-4d1e-bcff-067297ba9402</ind_cst_key>
<ind_first_name>Olivia</ind_first_name>
<ind_last_name>Bilbyfive</ind_last_name>
<cst_org_name_dn>OLB Test Org 1</cst_org_name_dn>
<cst_eml_address_dn>obilby@avectra.com</cst_eml_address_dn>
<adr_line1>7901 Jones Branch Dr</adr_line1>
<adr_city_state_code>Mc Lean, VA 22102-3316</adr_city_state_code>
</Result>
<Result>
<ind_cst_key>5428b5e7-11e2-4e78-8345-08d1f6e174fc</ind_cst_key>
<ind_first_name>Raaj3</ind_first_name>
<ind_last_name>Jeeth</ind_last_name>
<cst_org_name_dn/>
<cst_eml_address_dn>rjeeth@avectra.com</cst_eml_address_dn>
<adr_line1>7901 jones branch dr</adr_line1>
<adr_city_state_code>,</adr_city_state_code>
</Result>
<Result>
<ind_cst_key>a67ced09-75ba-4340-8b4a-0c9d27ee1675</ind_cst_key>
<ind_first_name>ksrao41</ind_first_name>
<ind_last_name>katras</ind_last_name>
<cst_org_name_dn>ORG A</cst_org_name_dn>
<cst_eml_address_dn>skatragadda@avectra.com</cst_eml_address_dn>
<adr_line1>7901 Jones Drv</adr_line1>
<adr_city_state_code>mc lean, VA 21222</adr_city_state_code>
</Result>
<Result>
<ind_cst_key>9fdb7924-1f25-423f-ad94-1b06b54b4607</ind_cst_key>
<ind_first_name>John</ind_first_name>
<ind_last_name>Smith</ind_last_name>
<cst_org_name_dn>Oracle</cst_org_name_dn>
<cst_eml_address_dn>sdemirtoka3@avectra.com</cst_eml_address_dn>
<adr_line1>8901 Leesburg Pike</adr_line1>
<adr_city_state_code>Falls Church, VA 21222</adr_city_state_code>
</Result>
</Results>
</GetDynamicQueryResult>
</GetDynamicQueryResponse>
</soap:Body>
</soap:Envelope>

If you had passed the value "1" in WithDescription then the result would be like this instead:

<Result>
<PrimaryKey>d971773e-1d3a-46a6-9852-a739247a3b63</PrimaryKey>
<FirstName>ksrao39</FirstName>
<LastName>katra</LastName>
<OrganizationName>ORG A</OrganizationName>
<PrimaryE-Mail>sbandaru@avectra.com</PrimaryE-Mail>
<AddressLine1>7901 Jones Drv</AddressLine1>
<CityStatePostCode>Mc lean, VA 21222</CityStatePostCode>
</Result>
<Result>
<PrimaryKey>22e1d8cd-80b3-4f6a-aa4c-adfed491e804</PrimaryKey>
<FirstName>Timothy</FirstName>
<LastName>Ward</LastName>
<OrganizationName>Avectra, Inc.</OrganizationName>
<PrimaryE-Mail>tward@avectra.com</PrimaryE-Mail>
<AddressLine1>7901 Jones Branch Dr</AddressLine1>
<CityStatePostCode>Mc Lean, VA 22102</CityStatePostCode>
</Result>

Parameters Collection

Beginning with the 2007.01 build of netFORUM, GetDynamicQuery supports ask-at-runtime parameters. In earlier builds, only queries without runtime parameters will function with GetDynamicQuery.

A new XmlNode parameter called Parameters has been added. Each <Parameters/> contains one or more <Parameter/> nodes with a <Name/> and <Value/> element as shown below:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<AuthorizationToken xmlns="http://www.avectra.com/2005/">
<Token>string</Token>
</AuthorizationToken>
</soap:Header>
<soap:Body>
<GetDynamicQuery xmlns="http://www.avectra.com/2005/">
<szObjectName>string</szObjectName>
<szQueryName>string</szQueryName>
<WithDescriptions>string</WithDescriptions>
<Parameters>
<Parameter>
<Name>string</Name>
<Value>string</Value>
</Parameter>
<Parameter>
<Name>string</Name>
<Value>string</Value>
</Parameter>
</Parameters>
</GetDynamicQuery>
</soap:Body>
</soap:Envelope>

GetDynamicQuery Sample Request with Parameters

The Parameter/Name is combination of a guid, then an underscore character, and then an integer counter e.g. 40794c6e-a417-4c7c-859b-3bc580adbe5d_2. You can get the parameter names from the GetDynamicQueryDefinition web method response; see this page to get an understanding of how the parameters are named. The Parameter/Value will contain the value that you want to pass with that paramter.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.avectra.com/2005/">
<soapenv:Header>
<ns:AuthorizationToken>
<ns:Token>bdd60d7e-4637-4406-8610-42e76817c1c9</ns:Token>
</ns:AuthorizationToken>
</soapenv:Header>
<soapenv:Body>
<ns:GetDynamicQuery>
<ns:szObjectName>Individual</ns:szObjectName>
<ns:szQueryName>Individuals on Committee</ns:szQueryName>
<ns:WithDescription></ns:WithDescription>
<ns:Parameters>
<ns:Parameter>
<ns:Name>40794c6e-a417-4c7c-859b-3bc580adbe5d_2</ns:Name>
<ns:Value>A</ns:Value>
</ns:Parameter>
<ns:Parameter>
<ns:Name>bbcdb8c8-3811-4f6b-9549-4b92badeda9b_0</ns:Name>
<ns:Value>b9ae781c-b9c1-4636-a05c-f61835be49c2</ns:Value>
</ns:Parameter>
<ns:Parameter>
<ns:Name>e6b7af49-eb96-4db3-875e-9eef859d1d31_1</ns:Name>
<ns:Value>72db64c1-63d2-4f70-88cb-cc38003e0beb</ns:Value>
</ns:Parameter>
<ns:Parameter>
<ns:Name>40794c6e-a417-4c7c-859b-3bc580adbe5d_3</ns:Name>
<ns:Value>01/01/2007</ns:Value>
</ns:Parameter>
</ns:Parameters>
</ns:GetDynamicQuery>
</soapenv:Body>
</soapenv:Envelope>

GetDynamicQuery Response With Parameters

Here is the response for GetDynamicQuery. It is no different from the way the method works currently. Whether or not the underlying query does or does not have ask-at-runtime parameters is irrelevant.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<AuthorizationToken xmlns="http://www.avectra.com/2005/">
<Token>fd55a4e0-9a9b-4cb9-86e9-44ffa7ff284e</Token>
</AuthorizationToken>
</soap:Header>
<soap:Body>
<GetDynamicQueryResponse xmlns="http://www.avectra.com/2005/">
<GetDynamicQueryResult>
<Results recordReturn="1">
<Result>
<ind_cst_key>04a67c96-c280-42f4-a2ba-2291290f027d</ind_cst_key>
<ind_first_name>sr_tester1</ind_first_name>
<ind_last_name>av</ind_last_name>
<ind_sfx_code/>
</Result>
</Results>
</GetDynamicQueryResult>
</GetDynamicQueryResponse>
</soap:Body>
</soap:Envelope>

GetDynamicQueryDefinition Web Method

In order to understand the definition of a specific query, including its ask-at-runtime parameters, see the GetDynamicQueryDefinition web method. This web method is a companion "documentation" web method to GetDynamicQuery.

Pagination

GetDynamicQuery paginates the list results of the query. The currentPage parameter determines which page of results is returned. The number of records per page is determined by the system option DataGridRowLimit. The Results node also indicates how many total pages are available and the total count of records that were returned by the query overall.

If the currentPage parameter is not passed, pagination does not occur.

See Also