The data results XML

A request submitted via the URL API will return an SplusDataResult object, represented as an XML structure.

Note: You can specify returning the SplusDataResult object as JSON rather than a binary object or SPXML. For more information about this, Return results as JSON.

Example

The following example contains the XML returned from a request to create a Fibonacci sequence, using the URL API:

http://servername:8080/SplusServer/api/v8/expression/eval?cmd=x<-filter(rep(0,%2030),%20c(1,%201),%20method="rec", %20init=c(1,%201))&async=false
Note: If you submit your request in a browser via an http:// request, and you do not see the XML displayed in the browser, right-click the resulting window, and then click View Source.

The resulting SplusDataResult object, in XML format, looks like the following:

<SplusDataResult version="1.0" createdBy="user1" serverTime="3487" scheduledMillis="1363216268135" prepTime="0" createdMillis="1363216268135" status="2" serverInstance="servername" scheduled="Wed Mar 13 16:11:08 PDT 2013" queueCount="0" percent="0.0" jobId="1" hasWarnings="false" hasTextOutput="true" hasReturnValue="true" hasError="false" engineTime="3109" created="Wed Feb 4 16:11:08 PDT 2015">

Note that the SplusDataResult object has the following properties:

SplusDataResult object properties
Property Description
version
The server XML version.
createdBy
The login name of the user who created the request.
serverTime
The number of milliseconds the job spent on the server.
scheduledMillis
The date and time that the request was scheduled to run, in milliseconds since epoch.
prepTime
The number of milliseconds the server takes to prepare to run the job (that is, preparing an available engine).
createdMillis
The date and time that the request was created, in milliseconds since epoch.
status
‘2’ indicates that the job is done. (Other status options include waiting (0), running (1), done with error (3), failed (-1), and interrupted (-2)).
serverInstance
In a clustered environment, the server containing the engine where the job ran. In a single-server environment, the name of the server.
scheduled
Specifies the date and time the request was scheduled. This synchronous request ran on the first available engine, shortly after the request was submitted.
queueCount
Specifies the position in the queue while waiting to run.
jobID
The identifier for the job. If a user needs to find it later, the user can pass this jobID to find the job.
hasWarnings
‘false’ indicates that the example ran without warnings.

If hasWarnings displays true, they appear in separate section in the SplusDataResult object. For example:

<SplusWarnings>
  <![CDATA[
     {"count":1,"warnings":"12345"}
</SplusWarnings>
hasTextOutput
‘true’ indicates that there is console text describing the output. This text is contained in the object SplusTextOutput.
hasReturnValue
‘true’ indicates that the request produced an SplusReturnValue, which contains the SplusObject with the results.
hasError
‘false’ indicates that the example ran without errors.
engineTime
The number of milliseconds the job took to run.
created
Specifies the date and time the request was submitted.

The SplusReturnValue contains the XML that defines an R language object. The rest of the output contains other details about the returned results. The SplusTextOutput contains information that would normally appear in the R Console. You can retrieve the contents of this tag by calling getTextOutput (in Java), or by examining the SplusDataResult property TextOutput (in C#).

The following shows the code, which reflects the expression that the server processed to produce the results. You can retrieve the contents of this tag by calling getCode (in Java) or examining the SplusDataResult Code property (in C#).

<Code>x<-filter(rep(0, 30), c(1, 1), method="rec", init=c(1, 1))</Code>

The following shows the ResultsDir, which contains the location on the server where the results are stored. You can retrieve the contents of this tag by calling getResultsDir (in Java), or by examining the SplusDataResult property ResultsDir (in C#).

<ResultsDir>http://servername:8080/SplusServer/webdav/results/CA98699BC304B54B/</ResultsDir>
</SplusDataResult>
Related concepts