Find

Article
· Aug 17, 2023 1m read

Download Globals as XML using CSP

Inspired by a Question from @Evgeny Shvarov and a Reply from @Ashok Kumar T
I have created a base for Global download as XML file

How to use:
 
just call the page like http://<your_server>/csp/samples2/dc.Gdown.cls?GBL=global_name

gbl-name  without the initial ^ (caret)

The output has a default name <global_name>.XML  Your choice is available.

Known Limits:

  • you have to install it at your sourcing server
  • it is not tested/working across namespaces
  • there is no partial download
  • error handling is just basic or missing

There is space for personal improvements.

and this is it:

Class dc.Gdown Extends %CSP.Page
{

ClassMethod OnPreHTTP() As %Boolean [ ServerOnly = 1 ]
{
  #dim %response as %CSP.Response
  set %rcc=$Get(%request.Data("GBL",1),"")
  if %rcc]"" {
    set %rcd=$D(@("^"_%rcc))
    if %rcd {
      set %response.ContentType="application/xml"
      set %response.Headers("Content-Disposition")="attachment; filename="""_%rcc_".xml"""
    }
  }
  else  { 
    set %rcd=0
    set %rcc="Parameter GBL"
  }  
  quit $$$OK
}

ClassMethod OnPage() As %Status
{
  if '%rcd {
  &html<<html><head></head><body>
   #(%rcc)# &gt;&gt; not found </body></html>>
  quit $$$OK
  }
  do $system.OBJ.Export(%rcc_".GBL")
  Quit $$$OK
}
}





 





 

2 Comments
Discussion (2)2
Log in or sign up to continue
Question
· Aug 16, 2023

Web client from SOAP Service

I created a web service and used the Studio SOAP Wizard to generate a client from the WSDL file of the service. But the client is throwing the error as shown below

 WebServiceClientClass '' could not be instantiated, or the WebServiceURL Location could not be determined

What have I missed?

Is there a better way to create a client?

2 Comments
Discussion (2)2
Log in or sign up to continue
Question
· Aug 9, 2023

VS Code : unable to save file to server

When I open a class in VS Code and I want to save it I'm getting the following error : Non-JSON response to /api/atelier/v7/DEV/doc/API.Mollie.Execute.cls?ignoreConflict=0 request. Is the web server suppressing detailed errors?

Also I always get a popup when I open VS Code "The extension wants to sign in using InterSystems Server Credentials."

3 Comments
Discussion (3)4
Log in or sign up to continue
Question
· Aug 4, 2023

Azure Databricks JDBC connection to Intersystems

We encountered difficulties while attempting to establish a JDBC connection to Intersystems using AZURE Databricks, resulting in an inability to retrieve data. The JDBC version utilized was intersystems-jdbc-3.3.1.jar. If anyone has successfully employed Databricks for establishing a connection, we would appreciate information regarding the libraries you used

 

Error Message:
org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3 in stage 0.0 (TID 3) (10.140.70.71 executor driver): java.sql.SQLException: [SQLCODE: <-25>:<Input encountered after end of query>]

7 Comments
Discussion (7)3
Log in or sign up to continue
Question
· Jul 27, 2023

Is it possible to get a list all active open TCP/IP connections made by IRIS ?

There is several classes that allow to create TCP/IP connections (eg: to connect to a service).

Example : %Net.FtpSession (port 21), %Net.HttpRequest (usually port 80 or 443)

AFAIK connection will stay open unless closed explicitly or if variable that hold the instance is garbage collected.

Is there a way to get a list of all active (open) TCP/IP connections IRIS is maintaining so far ?

I took a look at Portal (eg: in dashboard, "System Resource Statistics") but couldn't find anything. Web Gateway panel provide information about connections but this is incoming connections for CSP pages. I am look for external connections (the other way around).

If it's not available in Portal, some API / classes will be fine too.

I could of course run TCPView , netstat or something like that but I am looking for something built-in in IRIS.

6 Comments
Discussion (6)2
Log in or sign up to continue