Alexander Koblov · Dec 1, 2020 go to post

Hi.

You need to specify

Parameter ARGUMENTSTYLE = "message";

For example:

Class delme.SoapService Extends %SOAP.WebService [ Language = objectscript, ProcedureBlock ]
{

Parameter ARGUMENTSTYLE = "message";

Parameter SERVICENAME = "MyService";

Parameter NAMESPACE = "http://tempuri.org";

Method Test(x As %String) As %String(XMLNAME="Root") [ WebMethod ]
{
	Return "Test"
}

}

Then response is following:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema">
   <SOAP-ENV:Body>
      <Root xmlns="http://tempuri.org">Test</Root>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Alexander Koblov · Nov 29, 2020 go to post

"Quick analysis shows that CSP Gateway for each request opens a new TCP connection to Cache SuperServer (port 1972) allocating CSP session and license slot."

That is not true.

  • Web Gateway (fka CSP Gateway) has pool of connections that it uses to handle incoming requests. If all existing connections are busy and its number is less than "Maximum Server Connections" [0] then Web Gateway indeed creates new connection. And keeps it in the pool of available connections until this connection is not used for "No Activity Timeout".

  • Each new HTTP request does not allocate CSP session. If the request identifies itself as a part of already existing session (via cookie or other means) then the CSP session is not created. Also, if this is a request to the REST or SOAP Service that has sessions disabled then session is not created.

  • Each new HTTP request does not allocate license unit. HTTP requests for existing sessions use the same license unit. HTTP requests for new sessions usually do allocate the license unit.

"SuperServer has no queues or pools"

  • It's possible to configure SuperServer to have pool of processes to be ready to handle incoming TCP connections [1]

[0] https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=GCGI_oper_config [1] https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=RACS_JobServers

Alexander Koblov · Nov 25, 2020 go to post

I think both should be used.

If an application needs some privilege for itself (=for all users), e.g. for reading database with code, then this should be role for the application.

If different users within same application have different permissions then this should (can) be handled via user roles.

Alexander Koblov · Nov 6, 2020 go to post

Hi Ramesh.

"Invalid cursor state" is an error returned by ODBC driver. Ensemble just shows this error to you.

It's expected that you don't get this error when you run the proc directly on SQL Server -- because there is no ODBC driver involved in this case.

What you can try is to run the same query from some other ODBC tool (e.g. WinSQL) and see if you are getting the same error message.

If you see the same problem -- the likely the issue is within ODBC-driver+SQL Server. If you don't see the same problem then indeed, something might require changing on Ensemble side.

Also -- try googling this error message "Invalid cursor state". As this error message comes from Microsoft ODBC driver there are perhaps discussions on Microsoft sites. For example, I found this one https://social.msdn.microsoft.com/Forums/en-US/f6466a82-caf7-4053-94a4-a6f756b2f5c6/calling-stored-procedure-invalid-cursor-state?forum=sqldataaccess

Alexander Koblov · Sep 15, 2020 go to post

I also don't know if this is fixed. Studio is backwards compatible, so you can try to use Studio from Caché 2018.1.4 to connect to Caché 2017.1 or Caché 2017.2 instance. Or you even can try to use IRIS Studio 2020.1

Alexander Koblov · Sep 14, 2020 go to post

In Studio if you open Watch view and select Call Stack tab and then select particular line then in the right part you'll see variables for current stack

Alexander Koblov · Aug 18, 2020 go to post

Hi Yone.

Notice -- 4th argument is status code of conversion:

ENSDEMO>set fecha = "2021-08-18T07:44:14.180+0000"
 
ENSDEMO>set nuevaFecha = ##class(Ens.Util.Time).ConvertDateTime(fecha,"%Y-%m-%d%T%H:%M:%S","%d/%m/%Y",,.status)
 
ENSDEMO>zw status
status="0 "_$lb($lb("<Ens>ErrGeneral","Extra text 'T07' not parsed before end marker ':'",,,,,,,,$lb(,"ENSDEMO",$lb("e^zParseDateTime+102^Ens.Util.Time.1^2","e^zConvertDateTime+3^Ens.Util.Time.1^1","e^^^0"))))

Adjust format and you'll get expected value:

ENSDEMO>set nuevaFecha = ##class(Ens.Util.Time).ConvertDateTime(fecha,"%Y-%m-%dT%H:%M:%S.%N%z","%d/%m/%Y",,.sc)
 
ENSDEMO>write nuevaFecha
18/08/2021
Alexander Koblov · Aug 11, 2020 go to post

David,

JDBC Gateway is used when IRIS needs to connect to 3rd party database via JDBC.

If you or your customers need to connect to IRIS via JDBC -- then JDBC Gateway is not needed. Just use superserver port.

Alexander Koblov · Jul 31, 2020 go to post

You can redirect results to the file. If you specify csv format then data is TAB-delimited.

SAMPLES>>set displaymode=csv
 
displaymode = csv
SAMPLES>>set displaypath=c:\temp\
 
displaypath = C:\temp\
SAMPLES>>set displayfile=results.txt
 
displayfile = results.txt
SAMPLES>>select * from Sample.Person
4.      select * from Sample.Person
 
 
C:\temp\results.txt.csv
C:\temp\results.txtMessages.txt
Alexander Koblov · Jul 9, 2020 go to post

Check if you have CryptoPro. If you have -- uninstall it, then install Caché, then install CryptoPro back

Alexander Koblov · Jun 25, 2020 go to post

You need to specify number of parameter in the variable:

s Args=10

See my original example

Alexander Koblov · Jun 25, 2020 go to post

This works both way.

Consider class:

Class dc.TestArgs
{

ClassMethod AcceptArgs(x...)
{
    write "Got following params",!
    zw x
}

ClassMethod NormalMethod(a As %String, b As %String, c As %String)
{
    write "we got in a: ",a,!
    write "we got in b: ",b,!
    write "we got in c: ",c,!
}

ClassMethod SendArgs()
{
    set p = 3
    set p(1) = "first parameter"
    set p(2) = "second"
    set p(3) = "third"
    do ..AcceptArgs(p...)

    write "works with usual argument style",!
    do ..NormalMethod(p...)
}

}

Notice in SendArgs we are constructing p -- array of arguments. We can pass it both to method that accepts args..., and to normal method.

USER>d ##class(dc.TestArgs).AcceptArgs(1,2,3)
Got following params
x=3
x(1)=1
x(2)=2
x(3)=3

USER>d ##class(dc.TestArgs).SendArgs()
Got following params
x=3
x(1)="first parameter"
x(2)="second"
x(3)="third"
works with usual argument stylewe got in a: first parameter
we got in b: second
we got in c: third
Alexander Koblov · Jun 11, 2020 go to post

I don't like 'isc'. It was (is) sometimes used as an abbreviation for "InterSystems Corporation". So that does not indicate clearly that package comes from Community.

'community' is fine. It's not too long.

Alexander Koblov · May 27, 2020 go to post

I would look for errors in javascript console (Web Developer tools).

Also I would double-check if database HSTMDATADEV indeed has packages, based on its name it looks like it could have only data, and there is also HSTMCODEDEV where actual packages are stored.

Alexander Koblov · May 20, 2020 go to post

Hi Mark.

I don't know where "undefined" word comes from on the trace, but when %XML.Reader reads empty element it reads it as character with code 0 -- $char(0), that corresponds to empty string in SQL:

Class Community.Test Extends (%RegisteredObject, %XML.Adaptor)
{

Property StatusLastChecked As %String(XMLPROJECTION = "element");

ClassMethod test()
{
        set xml = "<root><Test><StatusLastChecked></StatusLastChecked></Test></root>"
        set reader = ##class(%XML.Reader).%New()
        do reader.OpenString(xml)
        do reader.Correlate("Test","Community.Test")
        do reader.Next(.obj)
        zw obj
}

}

USER>do ##class(Community.Test).test()
obj=3@Community.Test  ; <OREF>
+----------------- general information ---------------
|      oref value: 3
|      class name: Community.Test
| reference count: 2
+----------------- attribute values ------------------
|  StatusLastChecked = $c(0)
+-----------------------------------------------------

So in your code you can compare with $C(0).

Also for details on handling empty strings, see following section in documentation:

Handling Empty Strings and Null Values

Alexander Koblov · May 20, 2020 go to post

Hi David.

Source code for EnsLib.FTP.InboundAdapter is available in the installation.

EnsLib.FTP.InboundAdapter calls method %Net.FtpSession:List to get files. And that method uses "LIST" command.

EnsLib.FTP.InboundAdapter:OnTask executes following resultSet to get files:

Set tSC=..%CurrResultSet.Execute($this,..FilePath,..FileSpec,..SubdirectoryLevels,$S(..%isSFTP:"FileListSSH",1:"FileList"),..SemaphoreSpec)  Quit:$$$ISERR(tSC)

And in OnInit, ..%CurrResultSet is initialized as follows:

Set ..%CurrResultSet=##class(%ResultSet).%New($$$CurrentClass_":DeepList")

Query DeepList is defined in EnsLib.File.Common, and it's just a proxy for the query that is passed as 5th parameter to the Execute -- FileList in this case.

And EnsLib.FTP.Common:FileList calls %Net.FtpSession:List.

Alexander Koblov · May 20, 2020 go to post

What Caché version do you have?

On my 2018.1.3 instance code is following:

// Look for pattern : version "1.8.0.1
// where the double quote may optionally be replaced with a single quote or ommitted
Set regex = "version\s['""]?(\d+(\.\d+)+)"
Set pos = $Locate(pOutput,regex,1,,versionWithPrefix)

// Get just the number from the previous pattern : 1.8.0.1
Set regex = "(\d+(\.\d+)+)"
Set pos = $Locate($Get(versionWithPrefix),regex,1,,version)

Notice -- $Get around versionWithPrefix.

Most likely Caché cannot find java home dir. Specify Java Home Directory in JDBC Gateway Server settings.

Alexander Koblov · Apr 16, 2020 go to post

Hi Rubens.

Works fine for me on IRIS 2020.1 with rusw locale, see below.

Perhaps you can try to export directly to file, instead of using stream.

USER>!type ..\..\csp\user\test.json
 
{
"a":"русский текст"
}
USER>set stream=##class(%Stream.FileCharacter).%New()   

USER>set stream.Filename = "c:\temp\qq.xml"                                      

USER>do $System.OBJ.ExportToStream("/csp/user/test.json", .stream,,,"UTF8")      
Exporting to XML started on 04/16/2020 12:13:33
Exporting CSP/CSR or file: /csp/user/test.json
Export finished successfully.
 
USER>w stream.%Save()
1

USER>!type c:\temp\qq.xml
 
<?xml version="1.0" encoding="UTF8"?>
<Export generator="IRIS" version="26" zv="IRIS for Windows (x86-64) 2020.1 (Build 215U)" ts="2020-04-16 12:13:33">
<CSP name="test.json" application="/csp/user/" default="1"><![CDATA[
{
"a":"русский текст"
}]]></CSP>
</Export>
Alexander Koblov · Apr 16, 2020 go to post

There are two preferred ways to limit facts that go into cube.

A) Build restriction option in cube. Change of build restriction requires recompilation of cube. Though you can call stored procedure there. B) %OnProcessFact callback in the cube class.

For details please see "Restricting the Records Used in the Cube" in the documentation [1]

Disadvantage of using data connectors is that cube synchronization is not possible for cubes based on them: [2].

[1] https://docs.intersystems.com/iris20201/csp/docbook/Doc.View.cls?KEY=D2MODADV_ch_advanced#D2MODADV_advanced_restricting_records

[2] https://docs.intersystems.com/iris20201/csp/docbook/Doc.View.cls?KEY=D2IMP_ch_current#D2IMP_current_overview_cannot_use_dstime

Alexander Koblov · Apr 13, 2020 go to post

Hi Asif.

We recommend that you don't import whole library in Java Gateway Wizard.

Create simple wrapper class with methods that you are going to call from Ensemble. And import only that class.

Specify library only as a classpath.

With that approach Ensemble will create only basic proxy class.

Alexander Koblov · Apr 9, 2020 go to post

%XML.TextReader traverses XML nodes. Each node can have different type. NACS is node of type Element. It does not have any value. Node 111111 is of type Chars. However it does not have any name. Thus the output that you see.

Hint: change line in your code as follows to see types of nodes :

set practices = practices_textreader.Name_"("_textreader.NodeType_"):"

Take a look here for data model of XML: https://www.w3.org/XML/Datamodel.html

See also class reference for %XML.TextReader. Particularly for Value property. It explains what this property holds depending on type of node.