go to post Rochdi Badis · Mar 8, 2018 this might be a dump question, but how can i check that? i've checked C & D drives ans SYSTEM has a full access, but don't know to check \\BACKUPSVRTHANKS
go to post Rochdi Badis · Feb 28, 2018 Thanks Robert, and that's my understanding as well because in our software we actually stream PDF file in the database and also can restore them as a physical pdf files to read them, but what i though is that the streamed files in the database is a COPY of the physical file that we used first and clearing the stream is only clearing the streamed bytes in the database not the actual original file, but now you mentioned that Clearing the stream will also delete the original physical file, I'll take than into account so that we don't loose any files just in case :)Thanks Robert.
go to post Rochdi Badis · Feb 28, 2018 by "content" you mean the physical file?, because to me, the content of a stream not the physical file.Thanks Robert.
go to post Rochdi Badis · Feb 28, 2018 Thanks KILL worked, I should've tried that , but that ready strange that stream.Clear() actually delete the physical file!!?Thanks
go to post Rochdi Badis · Feb 28, 2018 Thanks Guys,Just to be aware, the client is running Cache 2008 so the third parameter can't be used for Rename or Delete, and I think i found the problem, where in my code I'm opening the file as a Stream: set stream = ##class(%Stream.FileCharacter).%New() set stream.Filename = FILEPATH while 'stream.AtEnd { set LINE = stream.ReadLine() If LN>0 { s ^UTLV("data",LN)=LINE S ^UTLV("data")=LN }and the reason why the delete didn't work is because the the file (Stream) is opened.I tried to close or kill the stream using : D stream.Flush(), D stream.%Delete(), D stream.%KillExtent() or CLOSE stream and didn't work and if I use D stream.Clear() the file will be deleted all together, and I don't want to delete is at this stage, I only want to delete the file after all my processes in finish at the end of my last routine.so how can i close the stream so that the Delete method can function at the end?thanks Guys
go to post Rochdi Badis · Jan 16, 2018 Thanks by changing the dates it all worked out ok now.Thanks again
go to post Rochdi Badis · Jan 16, 2018 Sorry I'm lost here. and not sure what you in 1,2 or 3 !?The above request that I created in Cache was working fine and Posts ok to the required REST API, but then new requirement came up and added two array to it the REST API, and they send me the new JSON structure so I had to do the same to accommodate the change (the JSOM after But the REST API is expecting this JSON request:)!?the other difference is that Now they also require a Header, before they they only had a Body in their API. At first I thought that could be the comma after "]" in my JSON, but looks like is not the case, and I'm also wondering the way I added the header is correct or not? or do I also need to define the Header type to JSON as I did with content (Set Request.ContentType = "application/json")?In your case the first modification I would do is replacing dates with real dates, for example with 2014-01-11.I think my date is already like that!? do you mean removing the double quotes or changing it to YYYY-DD-MM? thanks Eduard
go to post Rochdi Badis · Jan 15, 2018 Never mind guys, I've added this kind of code and seems to be working I think. Set Body1 = ##class(%ZEN.proxyObject).%New() Set Body1.Test = "fiel" Set Body1.Test2 = "ttss" Set Emp= ##class(%ListOfDataTypes).%New() Do Emp.Insert(Body1) Set Body.Array = Emp Thanks
go to post Rochdi Badis · Jan 9, 2018 Hi Eduard, Not sure is I can still ask this in this current Post or I should just start a new post, but simply, given that we still have some clients running on Cache/ensemble 2008.2.6.964 and %ZEN.Auxiliary.jsonProvider is not available, is there a Patch that can be installed for JSON provider or they only option is to upgrade those clients to 2014?Thanks
go to post Rochdi Badis · Jan 8, 2018 WoooHooo, that worked, thanks Eduard.but by the way, I downloaded Cache 2017.1 and Set Request.Https=$$$YES the same syntax error !? just to mention . Thanks again Eduard for your prompt responses have a good day
go to post Rochdi Badis · Jan 8, 2018 Ahhh, I remember that, I did one before for sending emails utility.I've created one SSL Config (just s Simple one with just s name and kept default) and my code now is : Set List = ##class(%ListOfObjects).%New() Do List.Insert(Body) Set Request= ##class(%Net.HttpRequest).%New() Set Request.Server = "devtest.altus.net.au" Set Request.Location = "/STP_IF/rest/Employee/Create" //S Request.ProxyAuthorization="SVRWSVMhME4yOlVyYW51czY=" Set Request.Https=1 Set Request.SSLConfiguration="TLS" Set Status = ##class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(Request.EntityBody, List) Set Status = Request.Post(,2)but I get this error : {"Errors":["The request entity's media type 'text/html' is not supported for this resource."],"StatusCode":415}and by the way, is Set Request.Https=1 correct given that Set Request.Https=$$$YES not supported in Ensemble 2014? Thanks
go to post Rochdi Badis · Jan 8, 2018 Hi Eduard,I've changed the code as below (sorry, location :"/STP_IF/rest/Employee/Create") , but if I don' t provide HTTPS & SSLConfig I get the following error : "{"Errors":["HTTPS connection required."],"StatusCode":403}"The REST API that we connecting to has no SSL configuration required, so and if I set Https=1 (because Https=$$$YES is not supported in ensemble 2014) and set Request.SSLConfiguration="" or not setting SSLConfig at all I get this error: "SSL/TLS configuration '' is not activated."so is there a way to get it working with SSLConfig, because in many case or programming languages SSL is rather optional? Set List = ##class(%ListOfObjects).%New() Do List.Insert(Body) Set Request= ##class(%Net.HttpRequest).%New() Set Request.Server = "devtest.altus.net.au" Set Request.Location = "/STP_IF/rest/Employee/Create" //S Request.ProxyAuthorization="SVRWSVMhME4yOlVyYW51czY=" Set Request.Https=1 set Request.SSLConfiguration="" Set Status = ##class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(Request.EntityBody, List) Set Status = Request.Post(,2) with Request.Post() there is only brief documentation on it, so my understanding it test=1 means post to device and 2 send post and get response and not sure what rest 0 or 1 means as the doc doesn't mention it!?and I'm guessing that location in Post method is optional given that we set Set Request.Location = "/STP_IF/rest/Employee/Create"? Thanks Eduard
go to post Rochdi Badis · Jan 5, 2018 Hi Eduard,I thought that would the end of it but ...:)I've created the below sample to post a JSON object but the receiving Web Service didn't receive anything ! Am I missing something!?FYI Srever name & port are not required for this Wed Service. JSONPOST Set Body = ##class(%ZEN.proxyObject).%New() Set Body.Id = "123" Set Body.PayerEmailAddress = "email" Set Body.PayerBusinessHoursPhoneNumbe = "PayerBusinessHoursPhoneNumbe" Set Body.PayerAustralianBusinessNumbe = "PayerAustralianBusinessNumbe" Set Body.PayerWithholdingPayerNumber = "PayerWithholdingPayerNumber" Set Request= ##class(%Net.HttpRequest).%New() Set Request.Location = "https://devtest.altus.net.au/STP_IF/rest/Employee/" Set Status = ##class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(Request.EntityBody, Body) Set Status = Request.Post()it is also a pain to look through and understand Cache documentation in many case! for example, I've some examples on JSONobjects and arrays and try to replicate them but they came up with syntax errors eg. SET JArray=["somthing "] ORSet Array1 = ##class(%Library.DynamicArray).%New() SET Array1=[]so in both cases Array1 or JArray is not understanding [] so should be including or extending a classe(s) or ...etc I'm basically looking to handcraft the Body.%ToJSON() content to to be contained in [] so I can post it because this what Receiving Web Service is expecting the message to be like. so looking for somthing like : Set MyMessage="[" _Body.%ToJSON()_"]" but its not working for me at the moment!? Thanks