prashanth ponugoti · Dec 2, 2021

2017 ensemble POST not working and not giving any error

I am totally struck and last 3 days I am not able to progress much. Here I need to call POST method in REST endpoint in Business Operation.

Please find the code below, which is working fine in IRIS 2020.1 but not in cache 2017.

Set httpRequest= ##class(%Net.HttpRequest).%New()
Set httpRequest.Server = ..Adapter.HTTPServer
Set httpRequest.Location = ..Adapter.URL
Set httpRequest.SSLConfiguration = ..Adapter.SSLConfig Set httpRequest.Https = $$$YES
Set httpRequest.ContentType = "application/x-www-form-urlencoded" do httpRequest.InsertFormData("grant_type", pRequest.grantType)
do httpRequest.InsertFormData("username", pRequest.username)
do httpRequest.InsertFormData("password", pRequest.password) Set sc = httpRequest.Post("", 2) $$$LOGINFO("post"_httpRequest.HttpResponse)
catch ex
$$$LOGINFO("Exception:" _ex) }

This code is working fine and giving the resonse in  IRIS2020.1 in mylocal. Same code is not working in cache 2017.

Could you please suggest change to make it work in cache 2017,.



Product version: Caché 2017.1
1 155
Discussion (8)2
Log in or sign up to continue

Hi All

Set sc httpRequest.Post("", 2)

I tried to sc to loginfo below output I received. Any clue to resolve this issue. Please help me.

ENSEMBLEÇ'e^zCheckSSLCN+48^%Net.HttpRequest.1^1"e^zSend+188^%Net.HttpRequest.1^1 e^zPost+1^%Net.HttpRequest.1^1Se^zinvokeTokenAPI+13^THH.DocmanConnect.BusinessOperation.DocmanConnectTokenOP.1^1Re^zMessageHandler+6^THH.DocmanConnect.BusinessOperation.DocmanConnectTokenOP.1^1Ye^zMessageHeaderHandler+23^THH.DocmanConnect.BusinessOperation.DocmanConnectTokenOP.1^1e^zOnTask+42^Ens.Host.1^1e^zStart+62^Ens.Job.1^2$d^StartEnsembleJob+6^|"%SYS"|STU^1d^^^0

If I try to replicate some of these steps in my instance of Cache 2016, I get an error at:

Set httpRequest.Https = $$$YES

Does it make a difference if you try:

Set httpRequest.Https = 1

Thanks David,

I have tried but no difference, seems SSL issue. I will check network team tomorrow to resolve any proxy settings.

Did you created ssl config into management portal?

Hi Yuri,

Yes I have created one by downloading certificate form browser as .cer file. But when i tested getting error handshake failed. Will try gain. Thanks a lot.

Can you compare the certificate chain between your local system and the cache instance ? It could be possible your local instance trusts the root CA in the certificate chain but the server where cache instance is doesn't.

Hi Prashanth,

Based on the error status, this looks like an invalid SSL certificate on the REST endpoint. The certificate name is "*" but the server name is "". The certificate would need to have "*" to cover that domain. I would try calling the same endpoint in another test client (or even a web browser) to see if it gives you the same certificate error. If so you would have to get in touch with the owner of that API to fix their certificate.

If you're only able to replicate the issue in your Caché instance I would contact InterSystems Support.

As a last resort, you can probably disable checking the server certificate by doing:

set httpRequest.SSLCheckServerIdentity = 0

This is not recommended because it's insecure, but it might be useful as a debugging tool.

Hi Pravin,

Thanks for your immediate support.

Yes it seems SSL issue. But similar configuration in my laptop (local) . But my TEST-CLUSTER which is 2017 cache , i am getting issue. If version issue is not there then I am suspecting some firewall issue in test-cluster.

After checking with Network team , I will update more details.

Thanks again