Bernd Mueller · Jan 31, 2018 go to post

on my surface book win10-x64, in a test using a simple (non-time-intensive) math-function/calculation (atan2(x,y)) in Node.js returning back the result, it turns out that callouts by REST are ~100 times faster than callouts by a command-pipe/$ZF(-1), due to the overhead of creating a child process for each callout every time.

Bernd Mueller · Jan 30, 2018 go to post

Eduard, this was for a windows-platform only. I couldn't find a suitable windows command line tool for *raw* deflate/inflate compression/decompression, so i wrote my own, knowing that Node provides a built-in zlib module.
Please note that zlib, etc. or compression/decompression is not what this article is about in the first place.
I only have chosen this as an example of a function not directly available (by native) in Caché.
Maybe you're right and this is probably not the ideal function/example,  but the article is meant more about the mechanism and way/practice
and on how to use a REST callout in general as an alternative way (instead of using a shell/command callout) making Node modules and their capabilities available from within Caché.

Bernd Mueller · Jan 30, 2018 go to post

i would start using "postman" to try out google restful api for your particular needs. To see what exactly you need to sent (request) and what you get in return (response). With that in place you can start coding some kind of wrapper methods using %Net.HttpRequest for doing the same requests and preparing the appropriate results from the response for your further processing, as you've already figured out before by using postman.

HTH, Bernd

Bernd Mueller · Jan 28, 2018 go to post

Hi Soufiane,
as you can see in the GetAccessTokenFromRequest() method, the access token is taken from the http authorization bearer header or from the encoded entity body's access_token parameter.  As described in RFC6750, see here: https://tools.ietf.org/html/rfc6750

Your client need to send that way. Not within the url as a name/value param.

On resource server side you then need to continue with this, see section "Code Requirements" here: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GOAUTH_resource

Be also aware on the prerequisites and code requirements also.

HTH,
Bernd

Bernd Mueller · Nov 28, 2017 go to post

yes, thanks for the hint. I've reported a internal JIRA for our documentation team in order to correct it.

Thank you,
Bernd

Bernd Mueller · Sep 26, 2017 go to post

Hi Maarten,
sorry for the late reply.
What versions of Caché/Ensemble and CSPGateway/webserver's you are using?
Is there a Load-Balancing configured in between?
Is the websocket-connection using same web-app-path than csp-page?
Is it reproducible? How often does it happen? When does it occur? On first/initial websocket-connection or sometime changing in between?
Why is that causing you a problem?
It's very hard to say more with that limited information you've provided so far.
I would suggest you to contact WRC online since i believe this needs a deeper look and investigation.

Regards,
Bernd

Bernd Mueller · Aug 17, 2017 go to post

Hi Tom,
the Cache SOAP log does not show HTTP headers.  To see the SOAPAction header sent out by Cache-SOAP-Client you need to use something like tcpTrace, etc.
However, can you please try if it make a difference if you use

Parameter SOAPACTIONQUOTED=1;

in your soap-webclient?

If the web client has the parameter SOAPACTIONQUOTED=1, then the web client will quote the
SOAPAction value for SOAP 1.1.


If that does not help i would suggest you to contact WRC to open a WRC-ticket since this probably needs a more detailed review and deeper investigation.

HTH,
Bernd

Bernd Mueller · Aug 16, 2017 go to post

Hi Tom,
please look at the documentation link you've found in more detail.

You need to specify logfile as well. Log will not be written in global, it will be written in file, for example:

>Set ^ISCSOAP("Log")="io"

>Set ^ISCSOAP("LogFile") ="c:\temp\iscsoap.txt"

The SOAP-Log needs to be set per namespace, so it will be only active for that namespace.
Please also don't forget to disable SOAP-Log when you're done with you testings/debuggings. ( >K ^ISCSOAP )

HTH,
Bernd

Bernd Mueller · Aug 1, 2017 go to post

Hi James,
it seems you are correct, direct marco evaluation is not yet supported.
As a workaround, you can define class-parameters for the $$$ macros you wanna use in your installer/manifest class:

Parameter CacheVersion = {$$$CacheVersion};
...

which then can be referenced in XDATA manifest that way: (parameter expression)

${#CacheVersion}


HTH,
Bernd

Bernd Mueller · Jul 28, 2017 go to post

Hi Sebastian,
you can request the SMP login page (etc.) from time to time by https or http to see what is working.
Let me know if that is what you are asking for. Feel free to open a WRC problem so we can discuss this further on the phone, etc.
Kind regards,
Bernd

Bernd Mueller · Jul 27, 2017 go to post

ah, you are trying with /csp/samples/docserver. Be aware that for security reasons this web-app is by default *disabled*. If you wanna use it you need to *enable* it.

Bernd Mueller · Jul 27, 2017 go to post

Hi,
i guess you need to add a wildcard * mapping handler to webserver /cspgateway configuration to pass extension-less requests to the caché-server as well. What webserver are you using? IIS or apache?

Bernd Mueller · Jul 27, 2017 go to post

Yes, you can get the name/value params from the url by %request.Get("paramname") for example, but using query params at all is against good principles of REST.

Bernd Mueller · Jun 20, 2017 go to post

this is great news, Jeffrey. I am glad you got it working.

Yes, this is rest api, the trailing slash in url IS important :)

Bernd

Bernd Mueller · Jun 20, 2017 go to post

since via the private webserver it is working i don't think this (/api/atelier = disabled) is causing the issue.

Bernd Mueller · Jun 20, 2017 go to post

Hi Jeffrey,

it seems this is a specific configuration issue which needs a more deeper look. (further logging, etc.)

I would suggest you to contact WRC support so that we can continue investigation.

Thanks and Regards,
Bernd

Bernd Mueller · Jun 20, 2017 go to post

Hi,
ssl/tls (https) support for the atelier connections is planned for Atelier 1.1

It should work via external webserver too.

Did you get a response from http://<webserverip>:<port>/api/atelier/ in browser? (or postman, arc, etc.)

What version of Caché/HS you are running on server? (> write $ZV)

HTH,
Bernd

Bernd Mueller · Feb 20, 2017 go to post

Nice article, good job Michael. I guess order by LastName needs another approach!? THX, Bernd

Bernd Mueller · Jan 10, 2017 go to post

Troubleshoot #2

I just recently had a case on a customer site where their SAPJCo interface stopped working after the production or system gets restarted. This always results in the following error:

ERROR#5023: Java-Gateway-Error: java.lang.ClassNotFoundException ...

In order to make this working again, the sapjco3.jar and BAPI's always needs to imported/generated again.
The reason for this was, that using the SAPJCo installation/import webpage is setting and using the Class Path from the jar file during the import, but restarting production or system makes the production/service forget about it.
Solution: What's missing here is that in the EnsLib.JavaGateway.Service of the production the "Class Path" needs to be specified in the "additional settings" as well to the full-path reference to the sapjco3.jar.

With that setup in place, production and system could now be restarted without affecting the SAPJCo interface.

Bernd Mueller · Nov 7, 2016 go to post

i am using curl with basic-auth and this seems to work for me:

curl -v -u _SYSTEM:<password> http://localhost:<port>/playground/index


Every request results in new session. The same for logout request.

I assume that the client browser remains the first http-basic-auth credentials and reusing it for the second (logout) request as well.

If i skip the basic-auth in curl request for the logout i will get 401 Unauthorized which is expected.

HTH,
Bernd

Bernd Mueller · Nov 7, 2016 go to post

how did you login? Do you use url-name/value params or http-basic-authentication with the first initial request?

Can you log/check %session.SessionId and %session.NewSession?

Bernd Mueller · Nov 7, 2016 go to post

Hi Nikita,

do you've tried Set %session.EndSession=1 in your Logout()?

Regards,
Bernd

Bernd Mueller · Oct 10, 2016 go to post

on Unix and Windows you can use PIPES:

s prog="whoami",oldIO=$IO open prog:"QR" use prog read result c prog use oldIO w !,result
Bernd Mueller · Oct 10, 2016 go to post

if you already have pcl documents available, then probably using 3rd party pcl to pdf converter command-line tool would be the easiest solution for you. You can use $ZF(-1, <oscommand>) call-out from within COS to invoke conversion process.

(for example: VeryPDF PCL Converter, etc.)

HTH,
Bernd

Bernd Mueller · Sep 2, 2016 go to post

Hi Peter,
this is very specific issue and hard to say with the information you've provided so far.
Are you sure this is related to Zen/Caché/CSPGateway and not a client-browser issue?

We need more information on this for a further investigation.

What changes are made that makes it stop working?

What client-browser/version you are using, what Caché version on server?

I assume you are using an "old" IE version, right?

The navigation to the #2 page called from #1 does work and loaded correctly?
Only the DXImageTransform did not work as expected in that case?
Calling #2 directly makes it working?

Did you try using IE-Developer-Tools (F12) to inspect and compare page-source and component loadings of both?
Any errors in the console, etc.?

Maybe it's better for you to report this in the WRC, so that support can continue with you on this!?

Regards,
Bernd

Bernd Mueller · Sep 1, 2016 go to post

yes, with the html5 type $input layout object you have to add onkeypress:true to it in order that onevent() gets triggered.

And in onevent(eventType,key,value,docViewId,event), you can do for example :

//$input onkeypress:trueif (eventType== 'keypress') {var keyCode= event.keyCode|| event.which;console.log('keyCode :' + keyCode);if (keyCode== '13') {// Enter pressed -> Do somethingzenPage.doSomething(value);}}

HTH,
Bernd