Debugging services with the EGL debugger

You can debug your local EGL services similarly to the way that you debug other programs.

Prerequisites

You will need an EGL Service part, as well as a requester that has binding information for accessing the service.

Note that before you can debug a web service on WebSphere® Application Server, you must generate the service.

Debugging a local service

The simplest way to debug a service is to call it from a program in the same project as the service. You can then pass test values to the service and inspect the results.

Perform the following steps:
  1. Create a new EGL source program.
  2. In the program, declare a service variable that is based on the Service part that you want to test.
  3. Create a service binding in the deployment descriptor as an EGL service (not a web service) with a "local" protocol.
  4. Using the service binding, bind the variable to the service.
  5. In the main() function of the program, make at least one call to the service using that variable. The easiest way is to hard code the input values in the service call and write the output values to the console, as in the following example:
    program addTestProgram type BasicProgram 	 	
    
    myAddingMachine additionService 
       {@BindService {bindingKey = "additionService"}};
    
       function main()
          sumint int;
          sumint = myAddingMachine.addInts(5, 12);
          SysLib.writeStdOut("result = " + sumint);
       end
    end
  6. Set a breakpoint at the service call. See Using breakpoints in the EGL debugger.
  7. Set breakpoints in the service, as you would in any logic part.
  8. Debug your new EGL source program. At the breakpoint before the service call, step into the service code. The debugger pauses at the breakpoints in the service just as in any other logic part.

Capabilities

The following special capabilities are available for EGL-generated services or for Service parts that run in the EGL Debugger:
  • Remote access of VSAM files that reside on z/OS®
  • Calls to non-EGL-generated programs, where the callLink element of the linkage options part has the following settings:
    • The remoteComType property is set to DISTINCT
    • The remotePgmType property is set to EXTERNALLYDEFINED
  • Access to the following functions, which run operating system commands in the development environment: SysLib.callCmd and SysLib.startCmd.

For details on the tasks required to make those capabilities available, see VSAM support and, in particular, the “Access prerequisites” section.


Feedback