Stefan Cronje · Oct 7, 2018 go to post

The repo contains an example. Here is an example of exporting the stack to a string in terminal

DEV>set sc = ##class(Examples.DebugStack).TestDebugStack()
Examples.DebugStack     TestDebugStack  Calling Method InnerStackTest with value: 5
|  |- Examples.DebugStack       TestInnterStack pVal argument: 5
|  |- Examples.DebugStack       TestInnterStack tMyVal: 15
|  |- Examples.DebugStack       TestInnterStack Calling TestThirdLevelStack with tMyVal: 15
|  |  |- Examples.DebugStack    TestThirdLevelStack     pVal argument: 15
|  |  |- Examples.DebugStack    TestThirdLevelStack     tFinalVal: 35
|  |- Examples.DebugStack       TestInnterStack TestThirdLevelStack completed OK
Examples.DebugStack     TestDebugStack  TestInnerStack completed OK
 
DEV>

It will be more readable if placed in a text file or a CSV. The "columns" are tab delimited.

It has the option of providing output to a string or a global character stream.

Stefan Cronje · Oct 6, 2018 go to post

This is just an idea, and I may be corrected on this.
You get an array of artists. I can't find anything on storing arrays of the same key as you have in this scenario.

I would first do the web-service call.

  • Then create a DynamicObject using %FromJSON and the http response data as the source.
  • Get the array of artist from the DynamicObject using %Get("artists") on the DynamicObject instance.
  • Create an iterator on the object returned by the previous command using %GetIterator
  • Iterate through the collection - for each
    • Create a docdb entry and the properties or open an existing one. I recommend creating a separate method for this to keep the code concise.
    • Create a JSON stream of the current object on the iterator using %ToJSON(.tMyStream)
    • DO db.%FromJSON(.tMyStream)
Stefan Cronje · Oct 5, 2018 go to post

Which properties of the JSON are you trying to store? Is it one of the properties from the "artist" object in the "artists" array?

Can you provide the document class definition?

Stefan Cronje · Aug 5, 2018 go to post

Thanks. I've figured that much out. I just don't know which Azure product. I will create a trial/test account with them and play around with ICM and see what happens - that should answer many of my questions/concerns. If successful, I will attempt to create an article and post it on the community.

Stefan Cronje · Aug 5, 2018 go to post

Thank you. I am considering option 3, it is a learning curve, as I'do not have any experience in cloud computing.

I am considering Azure, as it is is the only cloud provider with servers in our country and on the continent. Any guidance as to which package/product to use on Azure?

Stefan Cronje · Jul 18, 2017 go to post

It seems like %Stream.FileCharacter does not use the LineTerminator that was set in the output file. Even when using Write and adding $char(13,10), it converts it to the OS setting.

I resolved this line terminator issue by using %Stream.FileBinary and converting my data to UTF8 prior to writing it to the binary stream.

Stefan Cronje · Jul 18, 2017 go to post

When writing to the filecharacterstream, I use Write and not Writeline, as the string is built up with the newlines and I use $char(13,10) specifically.

I just compared the files between Windows and Solaris, and the Solaris files are two bytes smaller - so probably the \r($c(13)) getting dropped.

Stefan Cronje · Jul 17, 2017 go to post

I need to have the newlines in. The only reason why files are used, is because Cache does not support the RSA PSS padding required to sign the web-service messages I need to send. I then write what needs to be signed to a file and use opensl to sign it.

The value that needs to be signed is:
X-Date:CurrentDate\r\n
x-Client-Key:KeyValue\r\n
MessageBody

See: https://community.intersystems.com/post/sha256-signing-rsa-pss-padding

So it builds up the file to sign using the values and $char(13,10).
Then signs it using SHA256 and RSA PSS padding into a new file.
The contents of the new file is then base64 encoded.
The base64 encoded value is then sent together with the file contents, date and Client Key.

This works on Windows, hence the question about openssl and the newlines.

Is the base64 encoding a possivle culprit?

Stefan Cronje · Jul 17, 2017 go to post

Thank you. I've also read up a bit and 8-bit contents will not be bothered by endianness.

You may have a point with the line endings. The value that is gettinhg encrypted has two \r\n in it - this works on Windows. I will try and change it to just \n for the Solaris server and see if that makes a difference.

Do you know if openssl uses the line-end to know up the where to sign and does it line by line, or does it include the line endings in the value that should be signed?

Apologies for all these questions. I am not very familiar with encryption, signing, openssl, etc.

Stefan Cronje · Jul 11, 2017 go to post

I've created a config file from some random example and placed it in the bin directory. I can run it from there in the command prompt, but the $zf does not execute it.

Would you mind sharing your openssl config file and where it should reside? Which paths should be configured on Windows?

Will the user require the %CallOut service to be available to do this on a locked down install(production environment)

Stefan Cronje · Jul 11, 2017 go to post

Thank you. If it was possible to up-mark the answer more than once, I would have done it.

There is a difference in the values created by Cache and by OpenSSL

Stefan Cronje · May 24, 2017 go to post

Thank you. The parameter of OnProcessInput being a %Stream.Object confused me, as that has no FileName property in the class reference. The FileName property did however work. I realize now that a FileCharacterStream object is passed to the OnProcessInput from the File InboundAdapter.

Regarding your question: I use the original file name in a Business Operation, which uses the File.OutboundAdapter. I concatenate a suffix to the original filename and then use putline of the OutboundAdapter to create the file.

Stefan Cronje · May 23, 2017 go to post

There are no transformations.

I create a new message and call an Operation using ProcessAsync in the Business Service. This message has a property for the File Name which I want to populate. with the name of the original file picked up by the business service.

Stefan Cronje · May 19, 2017 go to post

Thank you.

I think this will help. It will still fail when I do a ValidateObject on the created objects, right? So then I can get the errors that way.

Stefan Cronje · Mar 26, 2017 go to post

Thank you Tony.

This would mean that the password change service will have to be on a CSP application configuration which is unauthenticated by the underlying Cache web-service handler.

Another option may be to let the password never expire and perform peer certificate verification by issuing a certificate to the client and verifying it during the SSL/TLS handshake.
Is this possible in Cache on the CSP gateway in some way, on a User level or even on a CSP application configuration?

Stefan Cronje · Mar 18, 2017 go to post

Have you tried just regular SQL case.

case when some-condition

then x

else y

end