go to post Arun Madhan · May 21, 2019 Thanks for this detailed article but have a few questions in mind ( probably you might have faced/answered when you have implemented this solution) 1) These CI/CD builds on the corresponding servers are Clean build ? If the commit is about deleting 4/5 classes unless we do a "Delete" Exclusive/all files on the servers regular load from Sandbox may not overwrite/delete the files that are present on the Server where we are building ? 2) Are the Ensemble Production classes stored as One Production file but in different versions (with Different settings) in respective branches ? or dedicated production file for each Branch/Server so Developers merge Items (Business Service, Process etc) as they move them from one branch to another ? what is the best approach that supports this above model ?
go to post Arun Madhan · Feb 22, 2019 Hi Neil,Thanks for your answer.I believe it's just the way the POSTMAN console outputs the headers.Good news is that we finally got it working. After playing a bit with %Net.HttpRequest class we created a utility test class method - below - where we stopped using the ..Adapter.PostURL() method of the adapter class and called the Post() method of the http request class. We played a bit with the parameters in the header and voila! we were able to move past the authorization stage: ClassMethod CallDocmanAPI(pURL As %String, pToken As %String) As %Status{Set pOutput=$$$NULLOREFSet tAdapter = ##class(EnsLib.HTTP.OutboundAdapter).%New()set tStream = ..TestJsonReader()W !,tStream.Read(tStream.Size)do tStream.Rewind()W !,"URL : "_pURLSet pResponse = ##class(UCLH.SIP.Test.REST.DocmanResponse).%New()#dim tHttpRequest As %Net.HttpRequest#dim tHttpResponse As %Net.HttpResponseset tHttpRequest = ##class(%Net.HttpRequest).%New()set tHttpRequest.ContentType="application/json"set tHttpRequest.ContentCharset="UTF-8"set tHttpRequest.FollowRedirect=1Set tHttpRequest.Https=1Set tHttpRequest.Port=443set tSC = tHttpRequest.SetHeader("content-type", "application/json")set tSC = tHttpRequest.SetHeader("accept","*/*")set tSC = tHttpRequest.SetHeader("authorization","Bearer "_pToken)set tSC = tHttpRequest.SetHeader("host","api-demo.docmansandpit.com")set tSC = tHttpRequest.SetHeader("accept-encoding","gzip, deflate")set tSC = tHttpRequest.SetHeader("cache-control","no-cache")set tHttpRequest.SSLConfiguration="TestDocman" set tSC = tHttpRequest.EntityBody.CopyFrom(tStream)W !,"HTTP HEADER: ",!,tHttpRequest.ReturnHeaders()try {Set tSC=tHttpRequest.Post(pURL,2,1)Throw:$$$ISERR(tSC) ##class(%Exception.StatusException).CreateFromStatus(tSC)}catch (ex) {Set tSC = ex.AsStatus()W !,$System.Status.GetErrorCodes(tSC)_" : "_$System.Status.GetErrorText(tSC)Quit }Quit tSC}Kind Regards.
go to post Arun Madhan · Feb 21, 2019 Hi there,We have been trying to replicate the same type of header as in POSTMAN -requests from POSTMAN work fine and we are able to publish to the API- currently we are sending the following:ENSEMBLE HTTP HEADER: User-Agent: Mozilla/4.0 (compatible; Cache;)host: api-demo.docmansandpit.comaccept-encoding: gzip, deflateauthorization: Bearer 1mIiqOSRtnhHKJ1486gkiVhHglkzZiIviseCYxvdYR9PXbZ1Eg5EgZWKtuBFtdubLlQ8j1vVz-GDY0vzeZadFhYbCBMXVrcPYVI8qVhT8OmxHW4QaFZea-0_elL6iX6T71rDYvMm5R0kYwNduBvkqMXQyEtDkCpFlQE1ollPRtGwm1qCgTF1dH0OcsUt5cL2Z37ESO9zqE5EXmIM4h6tuOBJaS7SiF5xaUyhmZUkpTBDwJi72V39SDIGJg6FU0qP2DYUOe7mppBE2STwj9jjyRB0x3r02XBwotJ9tG6G1tbLxkiEJwIUUOqX_NJKeV1mCi2kY-2KV1ZEC9G2BPniuAcache-control: no-cachePOSTMAN HTTP HEADER:cache-control:"no-cache"postman-token:"85d29666-2e8d-41c2-b8a3-3d77cd070494"content-type:"application/json"authorization:"Bearer 1mIiqOSRtnhHKJ1486gkiVhHglkzZiIviseCYxvdYR9PXbZ1Eg5EgZWKtuBFtdubLlQ8j1vVz-GDY0vzeZadFhYbCBMXVrcPYVI8qVhT8OmxHW4QaFZea-0_elL6iX6T71rDYvMm5R0kYwNduBvkqMXQyEtDkCpFlQE1ollPRtGwm1qCgTF1dH0OcsUt5cL2Z37ESO9zqE5EXmIM4h6tuOBJaS7SiF5xaUyhmZUkpTBDwJi72V39SDIGJg6FU0qP2DYUOe7mppBE2STwj9jjyRB0x3r02XBwotJ9tG6G1tbLxkiEJwIUUOqX_NJKeV1mCi2kY-2KV1ZEC9G2BPniuA"user-agent:"PostmanRuntime/6.4.1"accept:"*/*"host:"api-demo.docmansandpit.com"accept-encoding:"gzip, deflate"content-length:1255The 3rd party API keeps responding with 401: Unauthorized codes back.We had a look at the documentation for the %Net.HttpRequest class and it states it supports BASIC Http authorization (user:password), does that mean that the http request class doesn't support Token Authorization?Kind Regards.
go to post Arun Madhan · Nov 14, 2018 Ensemble internal API Dequeues a message only if receives an ACK for the ENQ Message. When that was configured at the Source the messages (that were queued at the exit) were sent out. :)