Getting Error/Message/Output Documents

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Server APIs: HTTP REST, COM/.NET, Java > HTTP REST Client Interface > Client Requests >

Getting Error/Message/Output Documents

A result document can contain the file URIs or relative URIs of error documents, message documents (such as logs), and/or output documents. (There are some situations in which a result document might not contain any URI.) The various kinds of URIs are described below.

 

To access these documents via HTTP, do the following:

 

1.Expand the relative URI of the file in the result document to its absolute URI
2.Use the expanded URI in an HTTP GET request to access the file

 

URIs (in the result document) of error/message/output documents

The result document contains URIs of error, message, and/or output documents. Error and message documents are job-related documents that are generated by the server; they are always saved in the job directory on the server. Output documents (such as the output of XSLT transformations) can be saved to one of the following locations:

 

To any file location accessible to the server. For output files to be saved to any location, the server must be configured to allow the client unrestricted access (the default setting).
To the job directory on the server. The server is configured to restrict client access.

 

If a client specifies that an output file be created, the location to which the output file is saved will be determined by the server.unrestricted-filesystem-access option of the server configuration file.

 

If access is unrestricted, the file will be saved to the location specified by the client and the URI returned for the document will be a file URI.
If access is restricted, the file will be saved to the job directory and its URI will be a relative URI. Additionally, there will be a mapping of this relative URI to the file URL specified by the client. (See the listing of Result document containing URIs of output documents.)

 

In summary, therefore, the following kinds of URIs will be encountered:

 

File URI of error/message documents

These documents are saved in the job directory on the server. File URIs will have this form:

file:///<output-root-dir>/JOBID/message.doc

 

File URI of output documents

These documents are saved at any location. File URIs will have this form:

file:///<path-to-file>/output.doc

 

HTTP URI of error/messag/output documents

These documents are saved in the job directory on the server. URIs are relative to the server address and must be expanded to the full HTTP URI. The relative will have this form:

/vN/results/JOBID/error/error.txt     for error documents

/vN/results/JOBID/output/verbose.log for message documents

/vN/results/JOBID/output/1           for output documents

 

In the case of output documents, output mappings are given (see example listing). These mappings map each output document URI in the result document to the corresponding document in the client request.

 

Expand the relative URI

Expand the relative URI in the result document to an absolute HTTP URI by prefixing the relative URI with the server address. For example, if the server address is:

 

http://localhost:8087/ (the initial configuration address)

 

and the relative URI of an error file in the result document is:

 
/v1/results/20008201-219F-4790-BB59-C091C276FED2/error/error.txt 

 

then the expanded absolute address will be

 
http://localhost:8087/v1/results/20008201-219F-4790-BB59-C091C276FED2/error/error.txt 

 

For more related information, see the sections: Configuring the Server and Getting the Result Document.

 

Use an HTTP GET request to access the file

Use the expanded URI in an HTTP GET request to obtain the required file. RaptorXML Server returns the requested document.

 


© 2019 Altova GmbH