How to debug services and applications with Enterprise Server Dynamic Debugging

  1. Connect to Enterprise Server Administration.
  2. Enable dynamic debugging for the enterprise server that you want to use for debugging.
  3. If you have not already done so, deploy the service or application to the server. Ensure that you also deploy the program's .cbl, and .cpy source files and the .idy file, which is needed for debugging.
  4. If your program is a service (Web Service or J2EE), as opposed to a CICS or JCL application, you will need to create a client program to submit requests for that service.
  5. At the UNIX shell prompt, run the cobesdebug utility, specifying (on the command line) the details of the service that you want to debug. It takes the following arguments
    Argument Description Usage Applies to
    type Specify either JCL | WS | J2EE, depending on the type of application or service you want to debug. Mandatory All
    jobname Specify the name of the job you want to debug. Optional JCL only
    stepname Specify the JCL step that you want to debug. Optional JCL only
    jobnumber Specify the number of a job in the help queue that you want to debug Optional JCL only
    program Specify the name of the JCL program that you want to debug Optional JCL only
    ipaddress Specify the IP address of the client that will be used to request the web service you want to debug. Enter the address in the form xxx.xxx.xxx.xxx Optional Web service only
    servicename Specify the fully qualified name of the service. This is formed by taking the name of the service and appending a hash(#) character, for Web Services, or a dot(.), for J2EE, followed by the name of the operation that you want to debug. For example, if the service name for the web service that you deployed is http://tempuri.org/wmapserv, and the operation to be debugged is Read, the fully qualified service name is http://tempuri.org/wmapserv#Read Optional Web service and J2EE
    server Specify the enterprise server region that you are using to run the services you want to debug Mandatory All

    For example:cobesdebug type=WS server=ESDEMO servicename=http://tempuri.org/wmapserv#Read

    cobesdebug now passes the service details to the enterprise server region specified by the server parameter and starts the Character Animator. The Character Animator waits for the service to begin.

    Each time a service is started, the enterprise server will check to see if it matches the details that you provided. If it does, the enterprise server attaches the Character Animator to the service.

    Note:
    • You must make sure that the debugger will be able to locate the source and .idy files for the application. To do this, set the cobidy environment variable to include the path for the .idy files, and set the cobcpy environment variable to include the path for the source files.
    • You must run cobesdebug under the same user ID that was used to start your enterprise server.
  6. Run the client program and enter some input.
  7. When the client submits the request, the enterprise server will attach your debugging session to the service.
  8. You can step through the deployed service in the usual manner.
  9. When you reach the exit program statement, cobesdebug waits for another instance of the service to start. If you have finished debugging, type Ctrl-C to close cobesdebug.