Retrieving documents from WebDocs

In order to query and retrieve WebDocs iSeries documents from a Windows based application, the following steps must be done.

Step 1: Make query

A document query must be made on the DOCS00 file in library RJSIMAGE to retreive a list of documents along with the document ID. 
SQL query filters can be done against fields TITLE, KEYWORD1-KEYWORD10 or any of the other fields in the table when you are querying the database. 
Ultimately the field needed to retrieve the actual image is the document ID from the DOCID field. 
The list may be presented to the user via HTML. 

Step 2: Get most recent version

After the document ID (DOCID) has been retreived, the DOCVER00 table must be queried to determine the most recent version of the document. 
The following sample SQL statement can be used to get the most recent version record:
After the version record has been read, the iSeries IFS file location and path can be determined by looking at the VDOCFILE field or VFTPFILE if the document has been moved to secondary storage.  Most like the VDOCFILE field will suffice. 
Then the IFS file or document ID can be passed off to a file retrieval mechanism. 

Step 3: Retrieve Copy

After the IFS file name has been determined, a copy of the file needs to be retrieved from the iSeries by one of the following methods:
Using WebDocs iSeries URL document retrieval

Programatically create Webdocs session via login URL:
Pass it via an HTTP call from your Windows based programming language or tool of choice.
Scrape Session ID
Then scrape the Session ID from the resulting HTML value
Pass new URL
Pass the following URL along with the document ID to the view URL and the document file will be returned:

Serve File

File can then be served via PC web application.
UNC share exposed via NetServer on the iSeries
FTP can be used to download the IFS file to the Windows PC if you have a Windows FTP component that can transfer files via FTP. 
Apache web site
An Apache Web Site that can expose the RJS imaging document directories so a variation of the URM document retreival may be used. WebDav can also be set up on the Apache Web Site and you can use a WebDav component to retreive any files. 
WebDocs iSeries .Net API
This API uses a .Net converted version of the JT400 classes, so startup times may or may not be sufficient for a high-speed web site unless objects are cached in the IIS server sessions via session variables.   
WebDocs iSeries Web Service & COM wrapper
The WebDocs iSeries Web Service and COM wrapper can be used to retreive documents from the iSeries. 
Note: This is currently in beta test mode and requires the web service to run on an Apache Tomcat Server and COM API to be registered on a Windows Server. 
Any other method of transferring files from the iSeries may also be used. 
Still have questions? We can help. Submit a case to technical support

Last Modified On:
You don't have the appropriate permissions.
No, open a new Support Case