Question
· Sep 30

How to include %syLDAP.INC

Hi,

%SYS.LDAP - InterSystems IRIS Data Platform 2025.2 - including private class members   states that
 

"abstract class %SYS.LDAP

Requires %syLDAP.INC to be included in your COS routine for some macro definitions."

 

How can I include %syLDAP.INC for the compilation of my code which uses %SYS.LDAP ?   I need the definitions for the $$$LADPxxxx macros (such as $$$LDAPSUCCESS).

Thank you.

W.

Product version: IRIS 2024.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1.1 (Build 347U) Thu Jul 18 2024 17:09:39 EDT [HealthConnect:7.2.0-2.m1]
Discussion (1)2
Log in or sign up to continue

When a dispatch class does not get automatically generated upon saving or compiling spec.cls in your REST web application, it might indicate an issue with the OpenAPI specification file or the configuration. Here’s how you can troubleshoot and resolve this:

  1. Verify OpenAPI Specification:
    Ensure that the OpenAPI 2.0 specification in the XData OpenAPI block of your spec.cls is valid. Errors in the OpenAPI definition can prevent the generation of associated classes like the dispatch class. Editing and recompiling the OpenAPI XData block should trigger regeneration of the dispatch class [1].

  2. Recompile the Specification Class:

    • If you're using a command-line interface, recompiling the specification class (spec.cls) should regenerate the dispatch and implementation stubs. Run:
      Do $system.OBJ.Compile("<YourPackageName>.spec", "cuk")
    • Ensure there are no syntax errors and that the spec.cls class extends %REST.Spec as required [1].
  3. Regenerate Using API Management Tools:
    Alternatively, you can use the API management tools to ensure correct regeneration:

    • The InterSystems IRIS /api/mgmnt/ endpoint or the CLI tool ^%REST can be employed to regenerate the REST service classes, ensuring the dispatch class (.disp) is recreated. For example:
      Set namespace = "<your namespace>"
      Set app = "<your application name>"
      Set filepath = "<path to OpenAPI file>"
      Do ##class(%REST.API).CreateApplication(app, filepath, namespace, .output, .error)

      This method directly ensures that new classes, including the dispatch class, are generated from the supplied OpenAPI definition [2][3].
  4. Check for Configurations:

    • Make sure the dispatchClass property in your web application's configuration still points to your expected package name and <PackageName>.disp. The dispatch class may not be visible depending on your settings (e.g., hidden generated items in your environment).
  5. Inspect Your Server Logs:
    Check logs for compilation failures or warnings when attempting to regenerate classes. Errors logged here can provide clues if something specific went wrong during the regeneration process.

  6. Force Creation:
    In rare cases or if the above methods fail, consider deleting the generated files (especially if they are corrupted), and retry creating them using the /api/mgmnt/ or the ^%REST CLI. You can delete the dispatch and spec classes, then recreate the application entirely via the API [1][3].

By following these steps, you can effectively address the issue and ensure that the necessary dispatch classes for your REST API are correctly generated. If you continue to face issues, debugging further with the specification file or the InterSystems Developer Community can offer additional insights.

Sources: