Eduard Lebedyuk · Apr 10, 2019 go to post

Your error looks like it's cause because there's no HeaderOut property defined in current class.

Anyway, you need to create a custom class which would be your header:

Class custom.Header Extends %SOAP.Header
{

Parameter XMLFORMAT = "literal";

Parameter XMLIGNORENULL = "RUNTIME";

Parameter NAMESPACE = "urn:epic-com.2013.Interconnect.Headers";

/// The XMLPREFIX parameter controls the prefix to be used for the XML namespace that
/// is given by the NAMESPACE parameter.
///Parameter XMLPREFIX As STRING = "";

Parameter XMLTYPE = "Epic-Client-ID";

Property Value As %String(XMLPROJECTION = "CONTENT", MAXLEN = 36) [ InitialExpression = "12349fe5-2ff8-4b79-b723-e69efbabcdef" ];

}

After that you need to create an instance of this class and add it to HeaderOut property of your WS client.

Eduard Lebedyuk · Apr 10, 2019 go to post

That's because first code generation is run during Test.String compilation, which does not have Test method.

Add something like this at the beginning:

#; don't generate any code if it not for a property
quit:%mode="method" $$$OK
Eduard Lebedyuk · Apr 10, 2019 go to post

Thank you!

NoContext helped. What does it mean?

This works too btw:

d %code.WriteLine("  q ..Test()")
Eduard Lebedyuk · Apr 9, 2019 go to post

Okay, how do I make this work with methods?

On property get/set I need to call instance method.

I've tried this:

Class Test.String Extends %String
{

Method Get() As %String [ CodeMode = objectgenerator ]
{
    do %code.WriteLine($c(9) _ "Quit ..Test()")
    quit $$$OK
}

}

And class:

/// set obj = ##class(Test.Obj).%New()
/// w obj.prop
Class Test.Obj Extends %RegisteredObject
{

Property prop As Test.String;

Method Test()
{
    quit $random(100)
}

}

But it fails to compile.

Eduard Lebedyuk · Apr 9, 2019 go to post

Yeah, apparently only DeepSee and Ens packages/globals can be mapped successfully.

Tried random package and it didn't show up even after mapping to %ALL.

Eduard Lebedyuk · Apr 9, 2019 go to post

I created these mappings (no restarts):

  • Ens* global mapping for ENSLIB -> USER
  • DeepSee* global mapping for ENSLIB -> %ALL
  • Ens* package mapping for ENSLIB -> USER

Here's the result:

Eduard Lebedyuk · Apr 9, 2019 go to post

Turns out it's much easier than I thought:

Class Test.String Extends %String
{

ClassMethod Get() As %String [ CodeMode = objectgenerator ]
{
    do %code.WriteLine($c(9) _ "Quit $g(^Test.String, 0)")
    quit $$$OK
}

ClassMethod Set(%val As %String) As %String [ CodeMode = objectgenerator ]
{
    do %code.WriteLine($c(9) _ "Set ^Test.String = %val")
    quit $$$OK
}

}

Example:

set obj = ##class(Test.Obj).%New()
write obj.prop
>0
set obj.prop=1
write obj.prop
>1
Eduard Lebedyuk · Apr 9, 2019 go to post

I downloaded IRIS Community edition (store/intersystems/iris:2019.1.0.510.0-community) and was able to create package and global mappings without any issues.

Eduard Lebedyuk · Apr 9, 2019 go to post

Is it one node or known nodes which can contain characters for escaping?

If so custom datatype may be a better solution.

Eduard Lebedyuk · Apr 9, 2019 go to post

Can you please provide an example?

I'm aware only of %XML.PropertyParameters but there's nothing but parameters.

Eduard Lebedyuk · Apr 9, 2019 go to post

Here's what I've coded.

Property:

Class Test.String Extends %String
{

ClassMethod StorageToLogical(%val As %String) As %String [ CodeMode = objectgenerator ]
{
	set property = $g(%member)
	do %code.WriteLine($c(9) _ "Quit """ _ property _ """")
	quit $$$OK
}

ClassMethod LogicalToStorage(%val As %String) As %String [ CodeMode = objectgenerator ]
{
	set property = $g(%member)
	do %code.WriteLine($c(9) _ "Quit """ _ property _ """")
	quit $$$OK
}

}

Class:

Class Test.Obj Extends %RegisteredObject
{

Property prop As Test.String;

}

However reference to property does not return anything (expected to return property name):

w obj.prop
zw obj.prop
>""

Any ideas?

Eduard Lebedyuk · Apr 8, 2019 go to post

Comment out  OnGetConnections method and restart the service.

Do you still get errors?

Eduard Lebedyuk · Apr 6, 2019 go to post

You can use DATEDIFF:

set tx = $ZDT($H,3,1,3)
hang 5
write $SYSTEM.SQL.DATEDIFF("hour", $ZDT($H,3,1,3), tx)
>0
write $SYSTEM.SQL.DATEDIFF("second", $ZDT($H,3,1,3), tx)
>-6
Eduard Lebedyuk · Apr 6, 2019 go to post

Good article!

Please post docker-compose definition as a text.

There's a code formatting style too

Eduard Lebedyuk · Apr 5, 2019 go to post

I would like to advise against this course of action, there are several reasons:

  1. Ensemble messages should be as small as possible. If you can pass id only, pass id only, etc. Minimizing message size keeps production efficient.
  2. ResultSet does not contain the data itself, it's more like a compiled instructions on how to get the data. Only when you're calling Next method the data is actually loaded into memory
  3. Results of SQL query should be immediately acted upon, because the older the SQL results, the more they differ with reality. it is best to pass parameters and execute query in-place.

If you want it for debugging purposes you can add a trace event which would store ids only for example, but if you actually need to pass a set of results between different business hosts it may be beneficial to you to rethink the production architecture.

Here's some questions:

  1. What business hosts do you have?
  2. What data do you pass between different hosts?
  3. Can you pass parameters between hosts and execute a query on a target host?
  4. Can you pass not a set between hosts, but rather elements individually?
Eduard Lebedyuk · Apr 3, 2019 go to post

Thanks, Aleksandar!

So HTTPS/WebServices/WebSockets are not widely supported?

I was just reading the standard spec and it was kind of implying that HTTPS or WebSockets are the way.

Eduard Lebedyuk · Apr 3, 2019 go to post

Can you explain a bit what do you want?

Do you want to execute some query and pass all results in it from one process to another in a message?

Eduard Lebedyuk · Apr 2, 2019 go to post

Some options:

> - Utilize another language or library that has methods to parse the data into an Excel file (https://stackoverflow.com/questions/17684610/python-convert-csv-to-xlsx).

If you want to use Python from Cache, check PythonGateway.