You can install the WebDocs iSeries web service on a Tomcat server and use it to upload, check in, search for, and download documents.
Prerequisites:
To set up the WebDocs iSeries Tomcat Web Service and DotNet ActiveX/Com SOAP Assembly DLL:
- Set up the web service:
- Run the EXE file and unzip the web service to C:\program files\Apache Software Foundation\Tomcat 5.0\webapps\WebDocsService.
Note: If Tomcat is not on your Windows PC, you will need to copy and paste the WebDocsService directory to the appropriate location after unzipping. To deploy directly on the iSeries, copy the WebDocsService directory to the iSeries and paste it into the Tomcat > WebApps folder. - Edit C:\program files\Apache Software Foundation\Tomcat 5.0\webapps\WebDocsService\Web.Config to include the following parameters:
<appSettings>
<add key="ipaddress" value="1.1.1.1" />
<add key="schema" value="RJSIMAGE" />
<add key="dbschema" value="RJSIMAGE" />
<add key="hostuser" value="WEBDOCS" />
<add key="hostpassword" value="TOMCAT" /> - Stop and re-start the Tomcat server.
- Test the WebDocs web service URL:
- Go to the WebDocs web service base URL, substituting your IP address for 1.1.1.1 and your port for 8089:
http://1.1.1.1:8089/WebDocsService/WebDocsService.asmx - Click docLoginSession > Test Form.
- For the log in, type:
- Click Invoke.
An XML response displays with a session ID, similar to the following, and the web service is working.
- Set up the SOAP client.
- Install the the SOAP client.
- Add it to a Visual Studio 2003 or 2005 project as a reference. The DLL assembly file name is:
C:\program files\WebDocsiSeriesSOAPClient\WebDocsiSeriesSoapClient.dll
Note: If you don't have Visual Studio 2003 or 2005, you can download Visual Studio 2005 Express for free from the Microsoft website. - To use the SOAP client with with ActiveX/COM calls:
Set objWD = CreateObject("WebDocsiSeriesSoapClient.ClassWebDocsiSeriesServiceWrapper")
Note: You cannot see properties and methods for the ActiveX/COM object in the object browser for VB5 or VB6 of Microsoft Office products. You need to use Visual Studio 2003 or 2005 to view object properties. However, you can still use the methods and properties, even if you cannot view them.
Sample VB Code for Calling WebDocs iSeries SOAP Client as an ActiveX
Calling a Document Search
Dim sSession As String
Dim objRS As Object 'Define object to hold array of docs
Dim objWD As Object 'Define WebDocs generic object
Set objWD = CreateObject("WebDocsiSeriesSoapClient.ClassWebDocsiSeriesServiceWrapper")
'Set base Web Service URL Path
objWD.setURL("localhost:8080")
'Login WebDocs Session
sSession = objWD.docLoginSession("TEST", "TEST")
If Trim(sSession) = "" Then
Msgbox "Login failed."
Exit Sub
End If
'Run Search looking for all docs with title of "TEST"
objRS = objWD.docSearch(sSession, "", "", "", "", "", "", "TEST", "", "", "", "", "", "", "", "", "", "", "")
If IsNothing(objWD) Then
Msgbox "Search unsuccessful"
exit sub
End If
Note: objRS is a string array that contains the resulting field names in row 0 and the record field values converted to String in row 1 and above.
Calling a Document Upload and Check-In
Dim sSession As String
Dim objRS As Object 'Define object to hold array of docs
Dim objWD As Object 'Define WebDocs generic object
Dim rtnbool As Boolean
Dim rtnupload As String
Set objWD = CreateObject("WebDocsiSeriesSoapClient.ClassWebDocsiSeriesServiceWrapper")
'Set base Web Service URL Path
objWD.setURL("localhost:8080")
'Login WebDocs Session
sSession = objWD.docLoginSession("TEST", "TEST")
If Trim(sSession) = "" Then
Msgbox "Login failed."
Exit Sub
End If
'Upload file
objWD.setTimeout(900000) '15 Minute Timeout
rtnupload = objWD.docUploadFileToIFSTemp(sSession, "c:\test.txt")
'Bail out on upload fail
If Trim(rtnupload) = "" Then
Msgbox "Upload unsuccessful"
Exit Sub
End If
'Check in New Document to TEST folder with only a description.
rtnbool = objWD.docCheckInNew32(sSession, rtnupload, "", "TEST", "", "", "", "", "Test Web Service", "", "", "", "", "", "", "", "", "", "", "*YES", "*COMP", 0, "*NO")
'New checkin failed.
If rtnbool <> 0 Then
Msgbox "Checkin unsuccessful"
'The following properties are available after a new doc checkin
MsgBox("Checkin Error:" & objWD.docGetNewDocErrorMessage & vbCrLf & _
"Error#:" & objWD.docGetNewDocErrorNumber & vbCrLf & _
"IFS File:" & objWD.docGetNewDocIFSFile & vbCrLf & _
"Size:" & objWD.docGetNewDocSize & vbCrLf & _
"DocID:" & objWD.docGetNewDocID)
exit sub
End If