go to post Antonio Garcia ... · Aug 29, 2018 Hi Francisco,Have you tried to use a custom BS so you can check if the file really exists? Or at least to identify when exactly the error is being generated?https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...
go to post Antonio Garcia ... · Aug 14, 2018 That's exactly what I am doing...using OnInit method: Method OnInit() As %Status{SET tSC=$$$OK // Add info to the log. $$$LOGINFO("*******************************") $$$LOGINFO("Run by:"_$Username)$$$LOGINFO(" > "_$SYSTEM.Process.UserName())...Nothing works...
go to post Antonio Garcia ... · Aug 13, 2018 Thank you but not sure about what you said.I don't have a %request. It is just a Business Service doing nothing...and all I want is to get the username who enable it last time. Well, actually not last time. The service is normally off, so when is turned on, I want the username to be recorded in the log.I have a function which actually run " write $USERNAME" and if I run it from Studio returns the username!
go to post Antonio Garcia ... · Aug 13, 2018 Thanks but I am afraid that did not work... when adding that into my service code and run it... I had an error message:ERROR <Ens>ErrException: <UNDEFINED>zOnInit+14^CUH.Serv.ODSCodeGlobalUpdate.1 *%request -- logged as '-' number - @' Do ##class(Ens.Util.Log).LogInfo($classname(),"OnInit",%request.GetCookie("Username"))'ERROR <Ens>ErrException: <UNDEFINED>zOnInit+13^CUH.Serv.ODSCodeGlobalUpdate.1 ^CacheTemp.EnsUsername(960) -- logged as '-' number - @' Do ##class(Ens.Util.Log).LogInfo($classname(),"OnInit",^CacheTemp.EnsUsername($job))'
go to post Antonio Garcia ... · Aug 3, 2018 not working but ping could be blocked in a firewall...and when I tried from my local PC, ping did not work either...I could be wrong but I am pretty sure is something blocking that connection but maybe based on the protocol...not sure...what I cannot understand is why browse to the web site works but httprequest not.Thanks
go to post Antonio Garcia ... · Aug 3, 2018 I have tried by IP, apparently 38.111.0.52so in IE: http://38.111.0.52:80 => ok, https://38.111.0.52:443 => okbut using:Set httprequest=##class(%Net.HttpRequest).%New() Set httprequest.Server = "38.111.0.52"Set httprequest.Port=80set status = httprequest.Get("/",2)DO $system.OBJ.DisplayError(status) ERROR #6059: Unable to open TCP/IP socket to server 38.111.0.52:80I have no idea what's going on
go to post Antonio Garcia ... · Aug 3, 2018 Thanks for the help:1. I have tried from the server where ensemble is running. In IE, I can access www.intersystems.com but when trying from studio...nothing blank response...all from the same matchine!2. I tried that and yes... ERROR #6059: Unable to open TCP/IP socket to server www.intersystems.com:80 so I think you are right but I cannot believe the problem is no visibility when in IE I can access the website with no issues.
go to post Antonio Garcia ... · Aug 3, 2018 Thanks for your help... I think the problem I am having is not with my code but with ensemble or IT. Apparently somehow the connection to external content is blocked. I can access to the websites with no issues from web browsers but when trying to access from studio or test SSL from ensemble...error!!Is there any security configuration to block that kind of access in ensemble?Thanks
go to post Antonio Garcia ... · Aug 2, 2018 I have tried to created an SSL/TLS configuration but not sure why is not working:It does not matter what I try to test it...always returns the same error:ERROR #989: SSL connection failed, make sure server address and port (not url) is specifiedI tried "intersystems.com" 443, "postcodes.io" 443...nothingThose sites I am trying to connect to....don't really need anything special to connect...just urlThanks
go to post Antonio Garcia ... · Aug 2, 2018 Yo are absolutely right although I am still confused.I copied httprequest.Get("http://www.intersystems.com",2) from one example found in the documentation so I was expected to work. Also, to get data from a website don't think you have to use https or SSL right? I tried with different APIs in other applications and just passing the right URL I was able to retreive the data.About httprequest.HttpResponse you are right again... I was using httprequest.HttpResponse.Data and outputtodevice but I was having an error as the object did not exist...so I tried to check if the object was really created or not...What would be the right script to connect then? I am trying to get data from this API https://api.postcodes.io/postcodes/Thanks
go to post Antonio Garcia ... · Jul 25, 2018 Apparently this is exactly what I am looking for: intersystems help but the problem is that I would prefer to use the standard file operation rather than create a new custom one.Writes a string to the file and appends to the string the characters specified in the LineTerminator property. By default, the LineTerminator is a carriage return followed by a line feed (ASCII 13, ASCII 10).If your operating system requires a different value for the LineTerminator property, set the value in the OnInit() method of the business operation. For example: Method OnInit() As %Status { Set ..Adapter.LineTerminator="$C(10)" Quit $$$OK } You can also make the property value to be dependent on the operating system: Set ..Adapter.LineTerminator="$Select($$$isUNIX:$C(10),1:$C(13,10))"
go to post Antonio Garcia ... · Jun 1, 2018 Not sure if this will help but I was having problems to connect to a database in ensemble. I needed to call a store procedure and one of the problems was because of the input variables was a VARCHAR(MAX).Have a look in case it can help... Post
go to post Antonio Garcia ... · May 11, 2018 Thank SeanWhen creating the class linked to the global a package name is required...but anyway I think it worked. So thank you very much for your help.
go to post Antonio Garcia ... · May 10, 2018 1) my question is because when I create the global I have to specify the package as well:Package: XXXName: XXXI am not sure if the CacheTemp has to be included in the package name or just class name so: XXX.CacheTempGlobal or CacheTempGlobal2) About how the global is structured: ^XXX.Stored.GlobalD = 3 ^XXX.Stored.GlobalD(1) = $lb("","Code3","TESTING3","","","FIRCROFT, LONDON ROAD","GREEN","EGHAM","",$c(0)," 0BS","1",$c(0),"A","P","H1","19740401","19910401",$c(0),$c(0),$c(0),$c(0),"0",$c(0),$c(0),$c(0),$c(0),$c(0)) ^XXX.Stored.GlobalD(2) = $lb("","Code2","TESTING2","","","FIRCROFT, LONDON ROAD","GREEN","EGHAM","",$c(0)," 0BS","1",$c(0),"A","P","H2","19740401","19910401",$c(0),$c(0),$c(0),$c(0),"0",$c(0),$c(0),$c(0),$c(0),$c(0)) ^XXX.Stored.GlobalD(3) = $lb("","Code10","TESTING10","","","FIRCROFT, LONDON ROAD","GREEN","EGHAM","",$c(0)," 0BS","1",$c(0),"A","P","H3","19740401","19910401",$c(0),$c(0),$c(0),$c(0),"0",$c(0),$c(0),$c(0),$c(0),$c(0))Thats how the global looks like. So basically the search the interfaces run is jut to check a specific field in the message is in the global field 14 (H1,H2,H3...) and if so translate that code to global field 1 (Code2, Code3, Code10...). But when importing the data any of the other fields can change...so that's why is better to remove the global completely and upload everything from the file.The problem with the logs is when so many duplicates are found in the file and the last one needs to be kept in the global...that made every single duplicate new code to be uploaded and the existing one to be removed...which I think generates an entry for each action...
go to post Antonio Garcia ... · May 10, 2018 WOW...that was quick...thanks Sean1) CacheTemp needs to be the name of the class or the name of the global? I mean:^XXX.Global.CacheTempGlobal OR ^CacheTempGlobal2) The process I designed read the file with the updated data, and upload line by line unless is a duplicate...so basically every line requires a query against the Temp global to check if that entry already exist or not. Sometimes, the new entry needs to replace the value in the temp global, so for that I delete the entry in the temp global and then add the new one. (That part is quite complex and I do not think is relevant for the global problem). Once the temp global contains all data from the file is when I start the process to export the global to a file, modify the name of the global in the file to point to the LIVE one and then when I update the LIVE global with that file.I cannot use the merge command as the file with the updated data includes all data not just new entries but everything...so I rather delete the LIVE global completely and then import the new global file.3) In order to avoid so many deletions of data to the temp global, I was thinking maybe to upload the content of the file into an array or something, remove all duplicates from there and then the final data to be uploaded to the temp global. But I am not sure if that will have a real improvement with just uploading/deleting to the temp global directly.Thanks
go to post Antonio Garcia ... · Apr 27, 2018 Thanks Robert...very helpfulI noticed that I need to have an ADAPTER to be configured for that service to work...otherwise Init method will not run. As soon as I had an adapter configured...$$$LOGINFO and OnInit method worked...Thanks
go to post Antonio Garcia ... · Feb 21, 2018 It worked. What I did is the following:Start & stop with a few seconds diff. so the service runs but stop immediately.START:WEEK-*-03T10:45:00,STOP:WEEK-*-03T10:45:10and use "Call Interval=999999999" so the following run during start/stop times is longer than that time so it will only run once.Thanks