go to post Robert Cemper · Apr 24, 2018 Last hint in prev. thread was:Contact WRC as 2008 is pretty aged.https://community.intersystems.com/post/cache-compile-problemlast comment:https://community.intersystems.com/post/cache-compile-problem#comment-48466
go to post Robert Cemper · Apr 23, 2018 ok did you try '2018-04-23' instead of $h ? SELECT top 3 EFFECTIVE_START_DATE PACKAGE.SOME_TABLE_NAME may show the expected default.
go to post Robert Cemper · Apr 23, 2018 The change from %Date to %String influences image of your target table and may affect implicit ODBC Data transmission that converts eg. +$h to YYY-MM-DD format ! once your data is a %Date again this should do it: ...... VALUES (?,?,?,?) %Execute($zdh(somedateYYYYMMDD,8),par2,par3,par4) If you test in SMP you have to check if you are in ODBC, Logical or Display mode. with TO_DATE() you just overrule this as string are the same in any mode. For ODBC the date is always 2018-04-25 For Display it's 04/23/2018 or 23.04.2018 depending on your local setting For Logial it is always 64761 (+$h)
go to post Robert Cemper · Apr 23, 2018 OK.you got a reply of 149 characters!And what was the result of ZZDUMP tText?It should look similar to this:ZZDUMP tText 0000: 3F C1 0A C2 30 20 0A 3F 5F 65 E4 2C 63 D2 0A 9D ?Á.Â0 .?_eä,cÒ..0010: 27 3D 0A 2A 5E 3C 59 D9 46 A1 ED 24 ED BC C8 DE '=.*^<YÙF¡í$í¼ÈÞ0020: DD 74 20 0A 6F C9 F7 FD 24 3F 7C 0A A4 31 A1 7B Ýt .oÉ÷ý$?|.¤1¡{0030: 44 E2 68 E0 B0 DD 3F D6 F9 29 32 F3 73 3F 3F 52 Dâhà°Ý?Öù)2ós??R0040: 3F B8 BC 3F BA 64 3F 24 2C F1 44 2B BB 3F 3F 0A ?¸¼?ºd?$,ñD+»??.0050: 3F 20 0A D4 BA 51 5A E9 FD 4E D5 20 56 7B 43 3F ? .ÔºQZéýNÕ V{C?0060: F3 F2 3F 62 A2 3F E9 CD 20 29 24 20 0A B2 35 C5 óò?b¢?éÍ )$ .²5Å0070: 3F 77 45 EB 3F 20 3F 3F A9 74 D6 E3 31 7A D7 32 ?wEë? ??©tÖã1z×20080: 46 EB CA 6E F4 65 CB 20 E6 3F 3F 5D 5A DF 71 20 FëÊnôeË æ??]Zßq0090: DC BA 3F E1 0A ܺ?á.I filled in the marked characters to get to your received size. The real value could help as there is a bunch of controls that could trigger a newline.The thing looks somehow encoded / encrypted or just binary.Do you have information on source system ? (the url is definitely faked)
go to post Robert Cemper · Apr 22, 2018 Classes and Methods forever!#1) for documentation#2) for all the possibilities and structural controls of OO development. #3).mac & .int is a left over from a previous millennium,a (failing) attempt to mimic OO with the mindset of procedural methodology.I'm personally disappointed that Atelier still supports mac.It was a historical requirement. Accepted. For last millennium. Eventually still for some internals.Definitely not for public use.
go to post Robert Cemper · Apr 20, 2018 you didn't get me. The browsers make something unreadable and useless out of it.That's just rubbish ?ÁÂ0 ?_eä,cÒ'=*^<YÙF¡í$í¼ÈÞÝt oÉ÷ý$?|¤1¡{Dâhà°Ý?Öù)2ós??R?¸¼?ºd?$,ñD+»??? ÔºQZéýNÕ V{C?óò?b¢?éÍ )$ ²5Å?wEë? ??©tÖã1z×2FëÊnôeË æ??]Zßq ܺ?ápls do:SET tText = tHttpResponse.Data.Read()ZZDUMP tTextWRITE tHttpResponse.Data.SizeSo we see the real HEX_content , eventual control characters, ... and the received number of charactersSimilar to your request the response is encrypted. Eventually, it can be decoded.
go to post Robert Cemper · Apr 20, 2018 where does Answer in Ensemble: come from ??pls add:write tHttpResponse.Data.Size,!ZZDUMP tText
go to post Robert Cemper · Apr 20, 2018 I had that feeling that it might be more.And took a look to ##class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject() as it is visible.It's nothing I would like nor to touch nor ever to maintain over future releases in parallel to ISC.
go to post Robert Cemper · Apr 20, 2018 Following your code example, this might be the quickest workaround TEST>set x = ##class(test.msg.struct.TestXML).%New() TEST>set x.statusId = "111" TEST>set x.service = "222" TEST>do ##class(Ens.Util.JSON).ObjectToJSONStream(x, .obj1, "aelotu") TEST>write $REPLACE(obj1.Read(),"statusId","status_Id"){ "status_Id":"111", "service":"222"}Not to pretty but useful.
go to post Robert Cemper · Apr 19, 2018 very short:.NET binding in Caché projects Caché Object classes to .NET with properties and methodsand services them with a private protocol. It is dependent on synchronized objects at both ends.you may know this picture:http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GBMP_introA RESTful API does something total different.You define request (for data or actions) and sent the request to Caché.And you get it back preferred in JSON style expressed.Your requests are straight HTTP with someWebServer in between on your way to Caché.SOAP does something similar. But it has an incredible overhead of XML.And as with .NET binding you need predefined data structures to be serviced.In extrem: With REST you just get back a string / stream and it is up to you to decide what this means:No predefinded structures. It is all your task to organize yourself.For .NET end I found this link:https://docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/calling-a-web-api-from-a-net-client For Caché side there are lots of useful articles in the forum already and examples in SAMPLES.Simple summary:For RESTapi you will not need InterSystems.Data.CacheClient.dll nor generated proxy classes using the Caché Object Binding Wizard for .NETYou are the owner of the exchanged data structures.
go to post Robert Cemper · Apr 18, 2018 Are looking for this?SELECT JSON_OBJECT('ID':ID,'Column1':COLUMN1,'Column2':COLUMN2,'DataID':DataID) FROM SQLUser.SampleDataCache for Windows (x86-64) 2017.2.1 (Build 801U)Sorry I don't have your data to show your resultsomewhat similar. SELECT top 3 JSON_OBJECT('name:':Name,'home':HOME_CITY,'dob':DOB) FROm Sample.Person{"name:":"Smyth,Valery B.","home":"Hialeah","dob":"2001-01-06"}{"name:":"Jones,Valery E.","home":"Islip","dob":"1959-11-11"}{"name:":"Newton,David H.","home":"Youngstown","dob":"1969-12-01"} Or all together:SELECT '{"result":'||List(xx)||'}' FROM(SELECT top 3 JSON_OBJECT('name:':Name,'home':HOME_CITY,'dob':DOB) xxFROM Sample.Person){"result": {"name:":"Smyth,Valery B.","home":"Hialeah","dob":"01/06/2001"} ,{"name:":"Jones,Valery E.","home":"Islip","dob":"11/11/1959"} ,{"name:":"Newton,David H.","home":"Youngstown","dob":"12/01/1969"}} The difference in DOB is just display mode vs. ODBC mode
go to post Robert Cemper · Apr 17, 2018 Sorry you went to CLASSES not to SQL !!! These are different worlds with different rules and syntax.And while your classname is WINSURGEDMP.WINSURGERESULTFACTI expect your TABLE to be named WINSURGE_DMP.WINSURGE_RESULT_FACTIt is just by accident if TABLEs and CLASSes have the same name !!!!!Especially if you refer to an EXTERNAl TABLE in a different (non Caché) database
go to post Robert Cemper · Apr 17, 2018 Recompile deletes all Cached Queries !See Dmitry's comment.and Mgmt Portal > System Explorer > SQL > Actions > Purge...
go to post Robert Cemper · Apr 16, 2018 #1) check that there exists a valid class WINSURGE*... #2) in Mgmt Portal > System Explorer > SQL you should see as Table WINSURGE_DMP.WINSURGE_RESULT_FACT#3) #SQLCompile Path=cancreg seems the real source of your problem as it sets a default package cancreg wherever that may come fromhttp://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCOS_macros#GCOS_macros_mpp_lbSQLCompile_PathEliminate it as your table is already full qualified WINSURGE_DMP.WINSURGE_RESULT_FACTIn addition : - VALUES :FIELD()do you really write to ALL fields of the external table ??? Hint:try to execute your SQL statement first from Mgmt Portal using dummy values before coding with strange macros directivesstart with a simple statement to see if the connection works as expected:SELECT COUNT(*) FROM WINSURGE_DMP.WINSURGE_RESULT_FACTthen try:INSERT INTO WINSURGE_DMP.WINSURGE_RESULT_FACT VALUES (1,2,3,4,5,6) -- whatever it needs
go to post Robert Cemper · Apr 16, 2018 I like that ! BUT: as in the original request I seem to miss the file.Read() to fill Line somewhere in the loop.
go to post Robert Cemper · Apr 16, 2018 Enable long strings in System Mgmt Portal and get strings up to 3.4 MBSystem > Configuration > Memory and Startup
go to post Robert Cemper · Apr 16, 2018 Time in Posix is the time as %Integer counting from Jan 1st, 1970. A UNIX definition.dates before are negative integers (e.g. birthdate before 1970 ) [that was a reason to start $h with Jan 1st, 1840. The year the oldest veteran (in 1960) from civil war at MGH was born ]
go to post Robert Cemper · Apr 16, 2018 the WRITE is just to visualize the examplethe loop in YOUR class could be: for msg=1:1 set msg(msg)=stream.ReadLine() quit:stream.AtEnd but that's just standard COS programming. Nothing special. see hereThen you have the local array msg with your SOAP messageSimiliar the Try{ } Catch {} construct that ignores the error that you experience as you don't get a real SOAP response here.
go to post Robert Cemper · Apr 15, 2018 You may create a normal SOAP Client in Studio using the Wizard.Then you add a transport class to display / dump your request. (example in SAMPLES) Class SOAPDemo.Transport Extends %RegisteredObject{ClassMethod DoSOAPRequest( client As %SOAP.WebClient, Action As %String, OneWay As %Boolean = 0, stream As %FileBinaryStream, ByRef responseStream As %GlobalBinaryStream) As %Status{ write !,"**** SOAP Request Begin ****",! for write stream.ReadLine(),! quit:stream.AtEnd write !,"**** SOAP Request End ****",! quit $$$OK}}Example to use it :SAMPLES>set soap=##class(SOAP.DemoProxy).%New() SAMPLES>set soap.Transport=##class(SOAPDemo.Transport).%New() ;; add cusomized transport SAMPLES>try {write !,soap.Mission() } catch {} ;; you don't get a reply, so ignore it **** SOAP Request Begin ****<?xml version="1.0" encoding="UTF-8" ?><SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:s='http://www.w3.org/2001/XMLSchema'> <SOAP-ENV:Body><Mission xmlns="http://tempuri.org"></Mission></SOAP-ENV:Body></SOAP-ENV:Envelope>**** SOAP Request End **** SAMPLES>try {write !,soap.AddInteger(17,4) } catch {} **** SOAP Request Begin ****<?xml version="1.0" encoding="UTF-8" ?><SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:s='http://www.w3.org/2001/XMLSchema'> <SOAP-ENV:Body><AddInteger xmlns="http://tempuri.org"><Arg1>17</Arg1><Arg2>4</Arg2></AddInteger></SOAP-ENV:Body></SOAP-ENV:Envelope>**** SOAP Request End **** so you get Envelope + Body well separated