Setting up the Integrated Debugger with Service Entry Points


If you are using Development Studio Client Version 5.0 and OS/400 V5R2, you can use Service Entry Points to debug the WebFaced RPG program. If you are using an earlier version of OS/400 or Development Studio Client Version 4.0, skip to the next topic: Your WebFaced Application's Job Environment. The only difference between these two ways of setting up the debug environment is that the Service Entry Point automatically starts the debugger in any job for a given program and user ID, whereas the manual way of starting the debugger is to point to a program in a certain job.

With a Service Entry Point, you are setting up the debugger to identify a breakpoint in a specific program. This will cause the debugger to take control if the program reaches this breakpoint, allowing you to debug from that point on. You also have to specify a user profile as part of the Service Entry Point setup, so that the debugger is invoked only if the program is started by this user. The Service Entry Point has the advantage that you can set up a breakpoint for a debug session before you actually start the program and have the job information where the program runs. This is a very useful feature in a non-interactive program environment where jobs are created on the fly as requests come in.

To run the integrated iSeries debugger in Development Studio Client Version 5.0, make sure that you have the latest PTFs for OS/400 V5R2. Check the WDSc Web site. As I am writing this section, the following PTFs are required for the ingrated iSeries debugger to work:

  • MF30131 5722999

  • SI07641 5722SS1

  • SI07934 5722SS1

  • SI08512 5722SS1

  • SI08017 5722SS1

  • SI08015 5722SS1

  • SI08017 5722SS1

You will also need the Development Studio Client with fix pack 5.0.1 applied to run the integrated debugger.

Setting a Service Entry Point

In order to set a Service Entry Point, you need the debugger started and you need to have the source of the program that you want to debug accessible in the source view of the debug perspective. Here I want you to start the debugger for the ORDENTR program. The easiest way to do this is to switch to the Remote System Explorer (RSE) perspective and use it to start the debug session.

If the RSE perspective is still open in the background,

  • Click the RSE icon on the sidebar of the workbench (Figure 15.1).


    Figure 15.1: RSE icon on sidebar

Otherwise,

  • Click the Open perspective icon.

  • Select Remote System Explorer from the pop-up menu as shown in Figure 15.2.

    click to expand
    Figure 15.2: Select perspective icon with menu

In the RSE perspective,

  • Expand your iSeries connection. This is the same iSeries connection you used to run the WebFaced application.

  • Expand the iSeries Objects node.

  • Expand the Library list node.

If you are not currently connected, this will connect you to the iSeries. Since you want to debug an interactive program to set the Service Entry Point, you need to start a 5250 emulation and sign on to the iSeries server.

On the command line in the emulation session, use the Start Remote System Explorer Server (STRRSESVR) command as shown in Figure 15.3.

click to expand
Figure 15.3: Command to start an interactive RSE session
  • Key in STRRSESRV CONNECTION, where CONNECTION is the name of the connection you are using in the RSE.

Your 5250 session will be busy and display a message that the RSE communications server is running; just leave it that way and go back to the RSE perspective in the workbench.

Now you can start the ORDENTR program for debugging.

In the library list (Figure 15.4),

click to expand
Figure 15.4: RSE perspective with pop-up menus for debugging
  • Expand the wflabxx node.

  • Locate the ORDENTR program.

To start the debug session,

  • Right-click the ORDENTR program in the tree view.

  • Select Debug As from the pop-up menu.

  • Select Interactive from the submenu.

The debug perspective displays with the source view in the middle left area of the workbench. Figure 15.5 shows the source view only.

click to expand
Figure 15.5: Debug perspective

In this source view,

  • Scroll down to the first executable line after the EXFMT operation for record format PROMPT in the program, on line 124.

  • Right-click this line.

  • Select Add Service Entry Point from the pop-up menu.

The Add Service Entry Point dialog appears as shown in Figure 15.6.

click to expand
Figure 15.6: Add Service Entry Point dialog

The required information is already filled in. You have a chance to change the user ID if the current one is not the one you use to invoke the WebFaced application.

  • Click the OK push button.

Now this Service Entry Point is registered, and when the user invokes this program, the debugger will be started and the program will be stopped at the Service Entry Point.

Run your application:

  • Open the WebFacing perspective, if it is not open already.

  • Right-click your wflabxx project.

  • Select Run on Server from the pop-up menu.

The index.html file displays in the browser.

  • Select the link that starts your WebFaced application.

  • Press command key 4 to prompt for the customer selection list.

Now the execution in this program is at line 124 and the debugger takes control. The debug perspective has focus; the source view for program ORDENTR is shown, and the program is stopped at the Service Entry Point. What you saved yourself by using the Service Entry Point is the need to start the ORDENTR program up front to identify a job before being able to start a normal debug session. Service Entry Points will make your life a lot easier when debugging any of your regular batch programs; they are very useful not only for WebFaced applications.

For instructions on debugging your program you can now skip to the heading Working with the Debug Perspective (page 320). The debugging is the same whether you use Service Entry Points or a regular startup of a debug session; only the invocation steps are different. You will notice in the screen shot under that heading that the normal debug session stops in the actual beginning of the program, whereas your program stopped at the Service Entry Point.




Understanding the IBM WebFacing Tool. A Guided Tour
Understanding the IBM WebFacing Tool: A Guided Tour (IBM Illustrated Guide series)
ISBN: 1931182094
EAN: 2147483647
Year: 2003
Pages: 153

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net