WebDocs Web Service and ActiveX/COM SOAP Client DotNet Assembly DLL - Support

WebDocs Web Service and ActiveX/COM SOAP Client DotNet Assembly DLL

From Support

Jump to: navigation, search

Contents

How to set up the WebDocs iSeries Edition Tomcat Web Service and DotNet ActiveX/Com SOAP Assembly DLL

The WebDocs iSeries Edition Tomcat Web Service and DotNet ActiveX/Com SOAP Assembly DLL are now available.

Step 1: Introduction

The WebDocs iSeries Web Service can be installed on any Tomcat Server V5.0 and above. The web service can be used to upload and checkin new documents as well as for searching for documents and downloading for viewing.

Step 2: Download

The DotNet ActiveX/COM Assembly can be used to talk to the web service from any VB scripting language including the RJS VB Script component. This is a nice way for non-DotNet programmers to be able to use the API from VB5/VB6/VBScript/VBA environments such as MS Office.

Download WebDocs iSeries Tomcat Web Service.

Username = *********
Password = ***********

Step 3: Install Web Service

=Run Executable

Run the EXE and unzip the Web Service to: C:\program files\Apache Software Foundation\Tomcat 5.0\webapps\WebDocsService

This assumes Tomcat is installed on your Windows PC. If not, you will be able to copy/paste the WebDocsService directory somewhere else after unzipping.

=Copy Directories

To deploy directly on the iSeries, simply copy the WebDocsService directory to the iSeries and paste into the WebApps folder under the tomcat directory.

Edit Configuration

Edit C:\program files\Apache Software Foundation\Tomcat 5.0\webapps\WebDocsService\Web.Config file settings with Wordpad or your favorite XML editor. Set the following parms:

  <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" />

Restart Tomcat

Stop and re-start the Tomcat server.

Test URL

WebDocs Web Service Base URL (This example assumes port 8089 and IP 1.1.1.1) (Only Main Portion of URL (http://1.1.1.1:8089) changes for each customer)

http://1.1.1.1:8089/WebDocsService/WebDocsService.asmx

When the web page appears, click the docLoginSession link.

Click the Test Form link.

Login

Type in: TEST for the user and TEST for the password or enter any other WebDocs user info and click Invoke.

You should see an XML response similar to the following with a session ID:

xmlns="http://tempuri.org/WebDocsService/WebDocsService">TEST09120608375282QZRCSRVS230712</string>

If you see the XML response listed above, the web service is working as expected.

Step 4: Install SOAP Client

Download

SOAP Client.

Check requirements

Make sure Microsoft .NET Framework 1.1 is installed on the user's PC.

Install

Install the WebDocs Web Service SOAP Client.

Add Reference

Once the SOAP client has been installed it can be added 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, Visual Studio 2005 Express can be downloaded from the Microsoft Web Site for FREE.

Using with ActiveX

The WebDocs iSeries SOAP client can also be used via ActiveX/COM calls because the DLL was created with COM Interop.

Set objWD = CreateObject("WebDocsiSeriesSoapClient.ClassWebDocsiSeriesServiceWrapper")

Note: You will not be able to see properties and methods for the ActiveX/COM object in the object browser for VB5, VB6 of MS Office products. Visual Studio 2003 or 2005 will need to be used to view object properties. However, even though the methods and properties cannot be seen directly by VB5/VB6, they can still be used.

Sample VB Code for Calling WebDocs iSeries SOAP Client as an ActiveX

Call 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.

Call a document upload and checkin

            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
Personal tools