Interview Web Service
The Interview Web Service enables you to use AJAX to implement web interviews within a web page, and provides support for HTML, XML, and JSON protocols that can be used to start interviews and submit answers to get subsequent pages. The service supports the following scenarios:
▪A survey embedded in an HTML page. Instead of reloading the entire HTML page, only the part displaying the survey would be updated.
▪Custom rendering of each question in an HTML page. This is an extension of the previous bullet where the question data is sent to the client instead of an HTML representation of the question. This allows the client to represent the question in an appropriate manner.
▪A mobile application where minimal data is transferred between the server and client and the rendering of the survey occurs on the client. An example of this might be a diary application on a connected mobile device.
▪An SMS survey where the questions are converted to a 160 character messages, sent to respondents, and the responses are converted back to answers.
The Web Service tier’s mrIWeb component supports the RESTful compliant Interview Web Service. The new web service allows users to use AJAX to implement web interviews within a web page, and provides support for HTML, XML, and JSON protocols. The web service provides the following benefits:
▪produces various output types:
HTML fragments for inclusion within an existing page
JSON representation of the question that can be rendered in a browser using Javascript
XML representation of the question for use by native or non-Javascript clients
HTML pages that allow web interviews to be conducted like mrIWeb.dll
▪is easy to consume
▪performs automatic load balancing across the session engines (just like mrIWeb)
▪can transfer minimal data between the server and client in order to accommodate mobile applications for devices in slow network environments.
The Interview Web Service is intended for JavaScript based clients in order to implement interviews within web pages using AJAX. For this reason, a REST web service has been implemented as it allows clients to make GET and POST requests to URLs without requiring SOAP encodings.
The web service allows interviews to be started and answers submitted. It also allows functions within the interview routing script to be called from the client. Interviews are started through an initial URL, with the responses allowing self-discovery of other URLs.
The Interview Web Service will by default use a base virtual directory (for example, http://<SERVER_NAME>/SPSSMR/Interviewing). Issuing a GET to a http://<SERVER_NAME>/SPSSMR/Interviewing/api/surveys/PROJECT survey returns the first page for a new interview.
By default, the response to a GET request is a JSON object representing an interview page. The HTTP response has a Content-Type of application/json.
To submit an answer to the page, a POST needs to be submitted to the URL. The format of the data in the POST must match the format specified in the URL (or JSON if no format is specified). If the Navigation is not included in the POST then Next is assumed. The response to the POST is the next interview page.
See
See also