Archive for June 28, 2011

Authenticate to the IBM i with WebClient

In many circumstances you need programmatic control of the IBM i authentication process, for example in single sign on situations. Please follow these basic steps for to implement.

Note that this method will work for both standard WebClient and for WebClient Mobile applications

1. Create a Plex function to accept your User Id and Password. You can create a panel for the user to enter in this information.

2. Add variables to the Local context:

  • IBMi Connection Property
  • Property Value
  • Return Value

3. Add Java source to authenticate the user to the IBMi


	   try {
			&(4:).set(new ObCharFld("   "));
			AS400 myas400 = new AS400(&(1:).getValue());        
	   	catch (AS400SecurityException i) {
			&(4:).set(new ObCharFld("INF"));
		catch (Exception e){
			&(4:).set(new ObCharFld("ERR"));

4. Once the user has been authenticated to the AS400, Java API calls are used to complete the process.


5. Make sure the file is located within the Java project in WebClient.


6. Obtain jt400.jar (Supplied by IBM) and add to your build path / deployment assembly in Eclipse. Compile and run the process.

First add to Java Project and add to build path

Copy and paste the jt400.jar file into the root of the Java project. Then right click and choose the build path option, libraries tab. Choose add JAR’s button.

Then add to Deployment Assembly in the Web project

Right click on the Web project. Select Properties, and select Deployment Assembly. Choose “Archives from Workspace”, then add the jar from the java project.




Note: This process is very similar to a standard Plex login to the IBMi. In client-server CA Plex apps each user has their own local copy of The difference here is that WebClient maintains a user copy of the file in the session.  So that the login is maintained for a specific user for a specific session

Contributed by Mark Schroeder. Mark can be reached at


May 2011 Newsletter Published

Highlights of this edition include:


Linking your CA Plex Java source folders in Eclipse

For many developers it is more convenient to link your CA Plex GEN folders directly into your Eclipse workspace, eliminating the need to run ANT scripts and move the Java source files. Eclipse will detect the fact that you have generated / changed your source files from CA Plex and will automatically build if you desire this.

To configure, follow these steps. You will link to the GEN/Src directory and to the GEN/Src/Res directory as generated from your Plex application. You will need to enter an exclusion pattern to avoid showing duplicate resource files in your project.

First, Right click on your Java project and select Build Path / Configure Build Path…

Next, select the link source button. Then enter the following path the your Plex GEN/Src directory:

Click next, and enter an exclusion pattern

Click Finish. Repeat for the Res (resource) subdirectory but do not add an exclusion pattern

You are done! Verify your path looks like this.


For large generate and build requests, Eclipse may compile before you finish generating. If you get out of sync, simply Refresh your Java project to rebuild any changed files.

© 2013 CM First Group - All rights reserved