Debugging Web Server persistent sessions

From m204wiki
Jump to navigation Jump to search

You can use the Janus Debugger to debug Janus Web Server "persistent session" applications. These are applications in which Online program execution is suspended while a browser user returns data to the program, whereupon the program continues. The Debugger supports two such types of Web Server programs:

  • HTML form processing using the $WEB_FORM_DONE SOUL function
  • Janus Web Legacy Support, which presents 3270 screens in a web browser

$WEB_FORM_DONE sessions 

Using the $WEB_FORM_DONE function, a SOUL program can serve an HTML form, suspend execution until the form is submitted, then resume executing the program at the point where it was suspended.

To debug a $WEB_FORM_DONE application:

  1. Invoke the program from your browser; then, in the Debugger Client, step through the program as usual.
  2. When a $WEB_FORM_DONE function call executes, the execution of the SOUL program pauses, and Session awaits browser displays in the Status bar.  
  3. Move from the Client to your browser, respond to the HTML form inputs, and submit the form.
  4. Return to the Client, where Persistent Session Resumed displays in the Status bar, and continue debugging.

Note: As a convenience, the Debugger can make your web browser window the topmost on your PC screen when the Client pauses as it processes the $WEB_FORM_DONE call.

To invoke this feature:
  1. In the Client, select Preferences from the File menu (or use the CTRL-P keyboard shortcut).
  2. In the Preferences dialog box, locate the Web Browser text box (in the Program Titles section) and provide a text string that matches some or all of the browser identifying title that displays at the top of the browser window.
    The characters in your matching string can be any case and match anywhere in the browser title. Any trailing blanks you enter are preserved
preferences16h2
3. Click Done.
The feature takes effect at the next execution of a $WEB_FORM_DONE function. The Web Browser setting that exists at the end of the Debugger Client session persists to the next run of the Client.

Note: By default, this feature does not take effect if the Client is not executing the part of a program that contains the $WEB_FORM_DONE. For example, the statement might be in code selected to be excluded from debugging.

However, if you also select the Windows When Suspended option in the Preferences dialog box (Execution Options section), you can make the feature apply whenever this statement occurs, even in code the Debugger is not actively executing.
preferences17hfrag

Legacy Support sessions

By automatically converting 3270 screens to HTML, the Janus Web Legacy Support feature lets you run under the Janus Web Server applications that do 3270 full screen reads. You can debug such an application with the Janus Debugger only if you also license the TN3270 Debugger.

To debug a Legacy Support application:

  1. Invoke the User Language program from your browser, and in the Debugger Client, step through the program as usual.
  2. When a READ SCREEN executes, the execution of the program pauses, and Session awaits browser displays in the Status bar.  
    If you have not also purchased the TN3270 Debugger, the web thread is softly restarted and the debugging session is terminated.
  3. Move from the Debugger Client to your web browser, respond to the screen (now HTML form) prompts, and submit the form by clicking the Enter button or a PF key button.
  4. Return to the Debugger Client, where Persistent Session Resumed displays in the Status bar, and continue debugging.

These events are reported in a sequence of lines in the Client Audit Trail page like the following:

2010 11 08 10:01:48.27   2   20 LI I SCREENO   2010 11 08 10:01:48.27   2   20 MS M204.1168: IN FILE GWDEB INCLUDE SCREENO 2010 11 08 10:02:10    Full Screen Read Pending  2010 11 08 10:02:22    READ SCREEN completed  

Note: As described above for $WEB_FORM_DONE applications, the Debugger can bring your browser to the top on your PC screen when the Client pauses for the READ SCREEN.

To invoke this feature:
  1. Select Preferences from the File menu.
  2. In the Preferences dialog box, locate the Web Browser text box (in the Program Titles section) and provide a text string that matches some or all of the title that displays at the top of the browser window.
    The characters in your matching string can be any case and match anywhere in the title. Any trailing blanks you enter are preserved.
  3. Click Done.