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, and event calendar, or any other data pulls.

This topic is a overview of how to pull data from netFORUM using xWeb. xWeb has three different web methods. The three primary querying web methods are:

GetQuery is the relatively simple to use for simple queries, and it is flexible and requires no setup/configuration. ExecuteMethod requires some setup but is more powerful, faster and has a deeper reach than GetQuery. GetDynamicQuery provides a web service interface to iWeb queries developed in the Query Tool. ask at runtime parameters are supported.

Web Method Summaries

GetQuery

GetQuery is undoubtedly the workhouse web method of any xWeb integration. xWeb is essentially a regulated SQL pass-through to the database. 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.

GetDynamicQuery

Although it appears to be valuable in theory, we have found in practice that GetDynamicQuery has a limited application and in many cases GetQuery can provide virtually the same functionality in a simpler interface. Moreover, the inability to pass ask at runtime parameters to a particular query further limited the effectiveness of GetDynamicQuery.

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 multi-dimensional 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, 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. Moreover, ExecuteMethod does not need to "interpret" any of the underlying netFORUM List Table metdata—it just runs the query defined in the web service.

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 speakers. 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