xWeb Query
Virtually any xWeb integration will need to query NetForum to get information about a member, run a member roster, get a committee list, anNetForum event calendar, or any other data pulls.
This topic is a overview of how to pull data from NetForum using xWeb. xWeb has three primary query web methods:
GetDynamicQuery
GetDynamicQuery has a limited application and in many cases GetQuery can provide virtually the same functionality in a simpler interface. The inability to pass ask at runtime parameters to a particular query further limits the effectiveness of GetDynamicQuery.
Abila sees GetDynamicQuery as useful for distributed integrations that have no custom setup for each installation.
GetQuery
GetQuery is undoubtedly the workhorse web method of any xWeb integration. xWeb is essentially a regulated SQL pass-through to the database -- which is good and bad. This is good in the sense that you can get data from just about any table in NetForum, but it's bad in the sense that it relies on the database knowledge of the integrator. For integrators who are accustomed to interacting with more concrete schema-driven web methods, the abstractness of GetQuery can be bewildering.
ExecuteMethod
ExecuteMethod was developed to provide a web method for people who ask, "Do you have a web method where I can write my own SQL?"
ExecuteMethod enables you to do this, with some limits. First of all, the SQL is not written from the integrator -- the integrator cannot just pass a SQL statement and get back a result. Instead, the SQL is written in metadata-driven "web service queries" defined in the NetForum iWeb application, which the integration then calls by name through the ExecuteMethod web method. These queries are written as inline Transact-SQL or database stored procedures, which are written in the FOR XML PATH SQL/XML syntax to return a multidimensional dataset in XML format, complete with root nodes, unlimited nested nodes, attributes, and all the other XML features build into SQL Server 2005.
When calling this web method, you pass the name of the query service query, and pass any runtime parameters as name/value pairs in a separate <Parameters> parameter.
ExecuteMethod is indisputably faster and more powerful than GetQuery.
As for speed, ExecuteMethod bypasses NetForum's standard table/column security limitations that GetQuery checks. instead GetQuery uses a different security model. ExecuteQuery does not need to interpret any of NetForum's underlying List Table metdata -- it just runs the query defined in the web service query.
As for power, ExecuteMethod lets you return XML in nested subnodes, whereas GetQuery can only return flat datasets. For example, ExecuteMethod could return a list of Sessions for an event, with nested Session speaker(s). Moreover, ExecuteMethod can return any kind of SQL, whereas GetQuery can return only defined NetForum Columns.
Finally, ExecuteMethod enables you to develop more concrete, pointed web service queries geared precisely for the data you want. This can simplify the job for the calling program and the integrator writing it, as they will not need to figure out the intricacies of the NetForum data model that GetQuery requires.
Other Querying Web Methods
- GetIndividualInformation - this is essentially a wrapper for GetQuery that returns a list of core fields about an Individual.
- GetOrganizationInformation - this is essentially a wrapper for GetQuery that returns a list of core fields about an Organization.