To ensure InterSystems IRIS does not care about the case sensitivity of JSON field names when using %JSON.Adaptor, you can utilize the %JSONFIELDNAME parameter. This parameter allows you to define an alias for a property name, mapping it explicitly to the corresponding JSON field name. For example:

Class Sample.Person Extends (%Persistent, %JSON.Adaptor)
{
    Property Name As %String(%JSONFIELDNAME = "name");
    Property Surname As %String(%JSONFIELDNAME = "surname");
}

With this configuration, the fields in JSON { "name": "John", "surname": "Doe" } will correctly map to the properties Name and Surname in the class without any case sensitivity issues [1][2].

Sources:

To differentiate system-defined and user-defined web applications in InterSystems IRIS, one can use the Management Portal or programmatically determine the type of application.

Using the Management Portal:

  1. Navigate to System Administration > Security > Applications > Web Applications.
  2. In the list that appears, each application's type will be identified in the Type column, with descriptors such as:
    • User application (CSP)
    • System application (CSP,System) [1][2].

Programmatically:

You can use the %System.CSP.GetDefaultApp method to return the default or other associated properties of applications for a specific namespace. Additionally, you might use specific commands to identify built-in applications as most system-defined apps have predefined names like /api/mgmnt, /csp/atelier, and so on [1][2].

Example Code to Create a Web Application in the %SYS Namespace:

zn "%SYS"
set props("Path") = "/opt/my/app/csp"
set props("Description") = "My Cool Application"
do ##class(Security.Applications).Create("/csp/test", .props)

The above code dynamically creates a web application definition and can be enhanced to include checks for identifying system vs. user-defined properties [3].

These methods should help differentiate the types of web applications efficiently based on your specific requirements.

Sources:

A built-in method to generate HTTP request and response messages from the %request and %response objects is not explicitly available as described in common documentation. However, if your question is about the GET or POST request handling using %Net.HttpRequest class, you can use the test argument of the Send method of %Net.HttpRequest to view the HTTP message formats:

  1. test=1: Outputs the HTTP request message without sending it.
  2. test=2: Outputs the HTTP response message.
  3. test=3: Outputs only the response headers.

For example:

Set objHttpRequest = ##class(%Net.HttpRequest).%New()
Set objHttpRequest.Server = "api.restful-api.dev"
Set objHttpRequest.Port = "443"
Set objHttpRequest.Https = 1
Set objHttpRequest.SSLConfiguration = "pm.community.intersystems.com"
Set pRequest = {
   "name": "Apple MacBook Pro 16",
   "data": {
      "year": 2019,
      "price": 1849.99,
      "CPU model": "Intel Core i9",
      "Hard disk size": "1 TB"
   }
}
Do objHttpRequest.EntityBody.Write(pRequest.%ToJSON())
Set objHttpRequest.ContentType = "application/json"

// Generate the HTTP request format
Do objHttpRequest.Send("POST", "/objects", 1)

// Send request and fetch HTTP response format
If objHttpRequest.Send("POST", "/objects", 2) { 
    Set objHttpResponse = objHttpRequest.HttpResponse 
}

Note: I used a public REST API just for test purpose.

Using test=1, you can view the raw request; test=2 lets you observe the returned response while also executing the request [1].

Fontes:

You can invite a colleague to the Developer Community and earn points through the InterSystems Global Masters Advocate Hub. This option is available as part of a challenge within the platform. You can navigate to the "Later" tab of your challenges on Global Masters to find the option to send an invite [1].

Sources:

Creating an index with the Data keyword specifies a list of properties whose values are stored within the index. This approach provides several benefits:

  1. Storing Property Values in the Index: If data values are stored in the index, this can improve query performance by allowing queries to be satisfied entirely from the index, thereby avoiding additional reads of the data global (master data). For example, if properties like Social Security Number (SSN), Date of Birth (DOB), and Name are stored within the index, queries fetching these values can execute directly against the index without accessing the full set of data [1][2][3].

  2. Efficiency in Selective Queries: Maintaining data within an index can be especially helpful for selective or ordered searches. For instance, when retrieving records based on sorting criteria or specific property conditions, having data stored in the index enables faster processing. For example, querying for names starting with "Smith" while ordering by name can utilize the index stored values efficiently [1][2][3].

  3. Example Syntax:

    Index QuickSearchIDX On Name [ Data = (SSN, DOB, Name) ];
    

    This syntax creates an index named QuickSearchIDX on the Name property, and it stores additional properties SSN, DOB, and Name within the index [1][3].

Limitations:

  • Bitmap Indices Restriction: The Data keyword cannot be used with bitmap indices due to constraints in how bitmap indices handle storage [1][2][3].

Sources:

The ObjectScript commands you are using to open a TCP connection and write to it appear correct based on InterSystems IRIS documentation.

  1. Opening a TCP connection: To initiate a TCP connection, the OPEN command syntax is correct. When using OPEN "|TCP|"_PORT:(IP::"PSE"):10, PORT should be in the allowed range, and IP provided should be an IPv4 address (e.g., "10.200.100.50"). The OPEN command reserves and initiates the device for communication, setting $TEST to 1 upon success [1].

  2. Writing to the TCP connection: Using the WRITE command with USE to specify the TCP device is correct. Particularly, the control *-3 flushes the output buffer forcing a write operation to the physical device. The control ensures that data moves from the TCP device buffer to the network buffer, and then to the physical device [1][2]. In the case of TCP communication, this approach is standard for ensuring immediate data transmission without buffering [1].

  3. Operating System Handling: The TCP device I/O in InterSystems IRIS leverages underlying operating system mechanisms for network communication. ObjectScript commands such as OPEN, USE, WRITE, and CLOSE interact with these mechanisms to establish connections, send or receive data, and close the connections gracefully [1].

Errors you are facing may be related to network configurations, firewalls, or incorrect VPN setups and not necessarily the syntax or execution of ObjectScript commands. The network team may need to investigate connection-specific issues on the firewall or VPN [1].

Sources:

To set up an automated linting and code style validation for InterSystems ObjectScript code using CodeTidy and GitHub Actions:

  1. Install the CodeTidy Package:

    • Ensure that you have ObjectScript Package Manager (ZPM) installed.
    • Use the command:
      zpm "install isc.codetidy"
      This will install the CodeTidy package required for linting ObjectScript code [1].
  2. Configure GitHub Actions Workflow:

    • Create a GitHub Actions workflow file in your repository. For example, create a file .github/workflows/objectscript-linting.yml.
    • Define your GitHub Action to include steps where CodeTidy is executed during your CI pipeline.
    • Example workflow:

      name: ObjectScript Lint
      
      on:
      push:
       branches:
         - main
      pull_request:
      
      jobs:
      lint:
       runs-on: ubuntu-latest
       steps:
       - name: Checkout code
         uses: actions/checkout@v3
      
       - name: Install dependencies (ZPM if needed)
         run: |
           # Install ObjectScript Package Manager (if not pre-installed)
           zpm "install isc.codetidy"
      
       - name: Run CodeTidy for linting
         run: |
           # Add commands here to invoke CodeTidy linting
           # as per its documentation
      

      Customize this template based on your CodeTidy usage and specific requirements. Integrate any file exclusions or specific rules for your linting process [1][2].

Refer to the CodeTidy Documentation for specific commands and configurations related to linting operations [1].

Sources:

The error message indicates that the connection to the FTP server is failing due to a missing required argument, identified with the error code 501. Here are troubleshooting steps and relevant settings that could help address your issue:

  1. Verify FTP Settings: Ensure that the FTP server settings such as server address (FTPServer), port (FTPPort), username, and password are correctly configured. These settings need to be defined within the FTP adapter or session you are interacting with. Use the FTPServerSet() and FTPPortSet() methods for configuring the server and port, respectively [1][2].

  2. Configure SSL/TLS Settings: If you're using SSL/TLS, ensure the configuration is correct. The SSLConfigSet() method allows specifying the TLS configuration entry for authentication. Incorrect or missing SSL configuration could cause issues like the one in your error message [1][2].

  3. Check Credentials: Use the CredentialsSet() method to specify the production credentials entry authorizing the connection to the FTP server. Ensure the credentials match those of the FTP server [1][2].

  4. Invoke Adapter Test: Use the TestConnection() method provided by the FTP Adapter to verify the connection state. This method can help correct connection-related properties if the adapter thinks it is connected but has lost the socket [1].

  5. Error Code 501 Analysis: The error code 501 suggests a protocol error, possibly due to missing arguments during connection initialization. Examine any mandatory parameters in your FTP setup that might be omitted [1][2].

  6. Debugging and Logging: Follow InterSystems guidelines for debugging FTP connections, possibly using logs or additional parameter tracing frameworks [2].

Example code snippet to configure the FTP settings:

Set sc = ##class(%Net.FtpSession).FTPServerSet("localhost")
Set sc = ##class(%Net.FtpSession).FTPPortSet("21")
Set sc = ##class(%Net.FtpSession).CredentialsSet("username_password")
Set sc = ##class(%Net.FtpSession).SSLConfigSet("SSLConfigName")
If $$$ISERR(sc) { Write "Error configuring FTP settings! ", sc }

Ensure FileZilla and the FTP adapter are configured for correct environment compatibility and log events to identify any specific errors [1][2].

Sources:

The problem you are experiencing with generating QR codes using ##class(%SYS.QRCode).GenerateImage may be related to Java configuration or folder permissions on your servers. The %SYS.QRCode class depends on Java, and missing or misconfigured Java installation could lead to such errors:

  1. Check Java Installation: Ensure that Java is installed and properly set up on the two problematic servers. The %SYS.QRCode implementation requires Java. The Java executable must be accessible, and its path is determined:

    • By the configuration parameter JavaHome in the [SQL] section of the .cpf configuration file.
    • By the JAVA_HOME environment variable.
    • Or through your system's PATH variables.
      Make sure the Java version is at least 1.7 [1][2].
  2. Verify Folder Permissions: Sometimes, such errors are caused by insufficient permissions on required directories where temporary files are created or accessed. Confirm that your application has the necessary permissions to write or read from the relevant folders [1][2].

  3. Alternative Versions: If upgrading is an option, InterSystems IRIS 2023.1 provides updates to QR code generation that do not rely on Java. This could simplify your setup by eliminating Java dependencies entirely [1][2].

If these steps don’t resolve the issue, additional debugging might be required to pinpoint the exact cause related to the specific setup of your problematic servers. [1][2]

Sources:

  1. A namespace is a logical abstraction that provides access to one or more databases. It acts as a layer that allows you to organize and manage data and code effectively. In contrast, a database is a physical construct, represented as a single IRIS.DATA file on the operating system, storing the actual data and code [1][2].

  2. It is not possible to write data directly into a database without specifying a namespace. When working with ObjectScript or SQL, operations are performed within the context of a namespace. Data is automatically written to the underlying database(s) mapped to that namespace [2][3].

  3. You can specify which database to write data into by first changing to the correct namespace and ensuring appropriate mappings are in place. In ObjectScript, you can change namespaces using the SET $NAMESPACE command:

    NEW $NAMESPACE
    SET $NAMESPACE="TargetNamespace"
    
  4. A database does not necessarily have to belong to a namespace; it can exist independently. However, a namespace provides the mapping to allow logical access to the database contents. A database can be associated with multiple namespaces, allowing the same data to be accessed from different logical contexts [1].

  5. A namespace typically has one "routine" database (for code) and one "data" database for global storage. However, complex mappings are possible where multiple databases can handle different data types or functional roles for a single namespace [1].

Sources:

The error you are encountering, SSL23_GET_SERVER_HELLO:unsupported protocol, often indicates that the SSL/TLS configuration being used is attempting to negotiate an unsupported SSL/TLS version for the connection. This can occur if a server supports a newer protocol like TLS 1.3 and your implementation is limited to older versions like SSL 3.0 or TLS 1.2.

Here are some troubleshooting steps and points of consideration based on the documents:

  1. Update SSL/TLS Configuration:

    • Ensure your SSLConfiguration in the %Net.HttpRequest object is correctly configured to use the protocols supported by the server. For example:
      objectscript
      Set request = ##class(%Net.HttpRequest).%New()
      Set request.SSLConfiguration = "groundca"
      Set request.Server = "osrd.atlassian.net"
      Set request.Https = 1
      Set tSc = request.Get("/rest/api/2/issue/<issue-name>")

      You may need to verify that the SSL/TLS configuration named groundca supports the correct set of protocols (e.g., TLS 1.2 or TLS 1.3) [1][2].
  2. Enable Supported TLS Versions:

    • If the error is due to protocol mismatch, check whether your Caché system supports the required protocols. Older versions of Caché may not support TLS 1.3, as indicated in some discussions around outdated versions [3][4]. If upgrading to a newer version is not currently an option, you could use an external tool like Stunnel in client mode to handle the TLS encryption [3].
  3. Verify Server Certificate and SNI:

    • If the server uses Server Name Indication (SNI), your configuration might need to explicitly include the SNI name. Some versions of Caché do not support SNI, and you may need a workaround for older setups [5]. For instance:
      objectscript
      Set request = ##class(%Net.HttpRequest).%New()
      Set request.SSLCheckServerIdentity = 0
  4. Troubleshoot Using curl:

    • Since Curl successfully connects using TLS 1.3, it confirms that the server and API key are working as expected. Compare Curl's configurations (e.g., certificates, protocols used) with your Caché setup to identify discrepancies [1].
  5. Certificate Matching:

    • Ensure the server name matches the values in its SSL certificate. Sometimes mismatches arise from redirects or incorrect configuration, which can result in an SSL handshake failure [1][5].

If these steps do not resolve the issue, further analysis of the environment and possibly server-side requirements may be needed. It's also advisable to consider upgrading Caché or alternative methods to establish newer protocol support. [1][5][3][4]

Sources:

Here is a programmatic solution to list all defined namespaces and their databases using both ObjectScript and Python:

ObjectScript Code

ClassMethod ListNamespacesAndDatabases()
{
    // List all defined namespaces
    Set namespaces = ##class(%SYS.Namespace).ListAll(.result)
    zwrite result

    // For each namespace, get its associated databases
    For i = 1:1:result.Count() {
        Set nsName = result.GetAt(i)
        Write "Namespace: ", nsName, !
        Set dbs = ##class(%SYS.Namespace).Databases(nsName, .dbInfo)
        zwrite dbInfo
    }
}

This code lists namespaces and retrieves their database configurations using the appropriate methods provided by the %SYS.Namespace class [1][2].


Python Code

To do this in Python, you need to work within the context of an InterSystems IRIS Python environment.

import iris

def list_namespaces_and_databases():
    result = []
    # List all namespaces
    namespaces = iris.cls('%SYS.Namespace').ListAll()
    for ns in namespaces:
        databases = iris.cls('%SYS.Namespace').Databases(ns)
        db_info = {key: value for key, value in databases.items()}
        result.append({'namespace': ns, 'databases': db_info})

    return result

# Usage
namespaces_and_databases = list_namespaces_and_databases()
for item in namespaces_and_databases:
    print(f"Namespace: {item['namespace']}")
    for db, info in item['databases'].items():
        print(f" Database: {db}, Info: {info}")

This Python example uses the iris module to interact with the InterSystems IRIS system. It retrieves both the namespaces and their associated databases using the same functionalities as ObjectScript [1][3].


These code snippets allow you to programmatically list namespaces and their databases from InterSystems IRIS. Let me know if you need further clarification or assistance!

Sources:

You may encounter the error Failed to save 'Utils.cls': Unable to write file 'isfs://mip:mz/API/Utils.cls?project=MZ' (Unknown (FileSystemError): Unknown Error) when trying to save or compile a class in Visual Studio Code due to several potential reasons.

Here are some troubleshooting steps based on relevant information:

  1. Do Not Alter First Line of New Files: If you are creating a new file in the Explorer tree in VS Code and modify or delete the first automatically generated line after naming the file (e.g., foo.cls), it may cause issues saving the file. Always start coding on the second line and retain the first untouched [1].

  2. Namespace and Server Connection Issues: Ensure your connection to the server is functional:

    • Check if you have configured the namespace and server connection properly in VS Code.
    • Use PuTTY or the browser-based management portal to verify connectivity to the server and test your file import or routine executions, as they should work without errors if connectivity is valid [1].
  3. Correct Permissions: Make sure that the user configured for your VS Code ObjectScript plugin has the necessary privileges to write to the namespace or specific filesystems in InterSystems IRIS.

  4. VS Code Plugin Setup: Ensure the required InterSystems ObjectScript extensions, such as the ObjectScript Extension Pack and Server Manager, are installed and properly configured [1].

If this doesn't resolve the problem, it may be useful to look at the server logs or other error details in the Audit Trail (%SYS.Audit) to get more information.

Sources:

I can’t find the information you’re looking for. If you rephrase your question, I might be able to help. You can also explore the following resources:

  • "Extend Your Web Server Configuration with the Web Gateway" [1]
  • "Web Gateway Registry in InterSystems IRIS" [2]
  • "The Web Gateway: Serve InterSystems Web Applications and REST APIs to a Web Client" [3].

Sources:

To pass a string to a routine from PowerShell, you can use a syntax similar to the following example:

call: irissession healthconnect -U user 'Say^ImplUtil("Your String Here")'

In ObjectScript, to call a routine with an argument, you use the caret symbol (^) followed by the routine name, then the method with the argument in parentheses as shown in this syntax:

DO Say^ImplUtil(argument)

Here, argument can be a string such as "hello, I'm the ROUTINE" enclosed in quotation marks. This ensures the argument is passed correctly as a string [1].

Sources:

The syntax issue with your line set gn=$name(..#GlobalName) likely stems from the improper use of # and the .. syntax to reference the Parameter value stored in your class. The $NAME function in ObjectScript returns the canonical name value of a variable or portion of a subscript reference. However, it works correctly only with properly defined references [1].

To resolve your problem:
1. Ensure that GlobalName is correctly defined in your class as a Parameter so it can be referenced.
2. When calling $NAME, use proper syntax for object property or parameter references. If GlobalName is a class parameter, replace ..#GlobalName with the evaluated value or other valid syntax that provides the global name string to $NAME.

The $NAME function returns a canonical name of a variable or subscripted reference, allowing you to subsequently use the @ indirection operator on the resulting string [1][2]. Here's a simplified example:

set gn=$name(^AGlobal)
set @gn@("index")="value"

Make sure ^AGlobal corresponds to the actual global structure you intend to modify or reference [1][2]. If rephrased, or if a specific class definition is missing, additional context might be required.

Sources:

During the installation of InterSystems IRIS 2025.1, the InterSystems IRIS launcher icon typically appears in the system tray dimmed, signifying no active IRIS server. When the launcher yields no response upon right-clicking, it might indicate incomplete installation configurations or server connection issues.

To address the issue:
1. Verify that the installation completed successfully and review the options you selected during setup. Ensure the icon is not dimmed due to the IRIS server not running [1][2].
2. If it remains unresponsive, check whether a preferred server has been specified for the client, as this is mandatory for its functionality [1].
3. Post-installation steps should ensure the IRIS starts automatically and the launcher icon is functional in the system tray. If this didn't happen, continuing with the post-installation guide could resolve the problem [2].

Sources:

You can determine when you've reached the end of the results in an EnsLib.SQL.InboundAdapter by using the following approaches:

  1. OnTask Method Extension: Extend the SQL inbound adapter and override the OnTask method. This method is triggered after all rows are processed. For example:

    Class Project.Ens.Adapter.SQLInbound Extends EnsLib.SQL.InboundAdapter {
       Method OnTask() As %Status {
           Set sc = ##super()
           If '$IsObject(..%CurrResultSet) {
               // Logic indicating the last row processed
               Set ^dbg($i(^dbg)) = "Last row"
           }
           Quit sc
       }
    }
    

    This logic ensures your custom logic runs after all rows from the query are processed [1].

  2. Adding COUNT() to Query: Modify your SQL query to include a count of rows. You can create a mechanism that tracks the current row being processed and compares it with the total rows (from COUNT). When the current row matches the total rows, it signifies you are on the last row:

    • Add a ROWCOUNT column in the query.
    • Increment a custom CurrentROW property during each call to OnProcessInput.
    • When ROWCOUNT equals CurrentROW, trigger any logic meant for the last row [1].
  3. Injecting Dummy Row or Marker: If modifying the SQL query isn’t an issue, you could add a dummy row or marker at the query’s end. This marker indicates the end of the result set [1].

These approaches allow you to handle custom processing when reaching the end of the query's result set.

Sources: