go to post Jimmy Christian · Jul 11, 2019 Hello Eduard,i was able to convert the HttpResponse.Data to String and than to the Dynamic Object. Worked great. Thank you.On the same line, i need to ask you of any template or suggestion to send a JSON data to a REST API.For eg. below is the JSON{"name":"abcdefghi","salary":"123","age":"23"}How do i send it to http://testing.restapiexample.com/api/v1/createemployee with POST request using the set tSC=..Adapter.PostURL(tConfig.URL,.tHTTPResponse,,pRequest)Below code is not working. Set pRequest=."{"name":"abcdefghi","salary":"123","age":"23" }"Your help will be appreciated.Thanks,Jimmy Christian.
go to post Jimmy Christian · Jul 10, 2019 Yes, Thank you. I just corrected the URL and it works now. Thank you Robert. One more question if you can assist in this context.So the response message i got back is in the HttpResponse object.How can i convert the HttpResponse.Data property to JSON and parse the values. Since the data i received is Stream, is there a way i can convert the stream to Dynamic Objects and parse it?Thank you.Jimmy Christian.
go to post Jimmy Christian · Jun 28, 2019 Thank you Marc. Looks like this Issue is resolved . Appreciate your input.
go to post Jimmy Christian · Jun 27, 2019 Yes, I did. set tRequest=##class(Ens.StreamContainer).%New(pInput) do tRequest.%Save() set tSC = ..SendRequestAsync(..TargetConfigNames,tRequest)Thanks,Jimmy Christian.
go to post Jimmy Christian · Jun 26, 2019 Hello Eduard,I used %Stream.FileCharacter to resolve the error on Operation which is complaining that "No Stream contained in StreamContainer Request".I am going to use the JSON serialization once i refer to some document about it. Thank you for help.Jimmy Christian.
go to post Jimmy Christian · Jun 26, 2019 Thank you Aldo for checking this out. I tried to make it much simpler by using what you suggested. I was hoping the operation to accept it since pInput is a Stream.But still the same error. Operation does not find STREAM in the ENS. StreamContainer. Class Hospital.ApptListFileService Extends Ens.BusinessService{Parameter ADAPTER = "EnsLib.File.InboundAdapter";Parameter SETTINGS = "TargetConfigNames";Property TargetConfigNames As Ens.DataType.ConfigName;Property SentMsg As %FileCharacterStream;Method OnProcessInput(pInput As %FileCharacterStream, Output pOutput As %RegisteredObject) As %Status{set tSC = $$$OK set pInput.LineTerminator=$c(10)try {while 'pInput.AtEnd { do pInput.ReadLine() set tRequest=##class(Ens.StreamContainer).%New(pInput) set tSC = ..SendRequestAsync(..TargetConfigNames,tRequest)}
go to post Jimmy Christian · Jun 18, 2019 Thank you Stephen. I will check the link you provided for more understanding on REST.
go to post Jimmy Christian · Jun 18, 2019 Hello Evgeny,Yes this worked perfectly. I think i did select %ALL role, but did not click on assign but only SAVED it.Thank you for all your help. But looks like at some point once i familiarize myself with this web and rest app build, i will need to learn more about security..Thanks,Jimmy Christian.
go to post Jimmy Christian · Jun 18, 2019 Thank you Nigel for the suggestions. Agreed, but since this is just a standalone training env, and for now i only want to have a hands on REST development, i think assigning %All role should be fine to see the output of the code ! Security will be my next hands on once i am familiar with the REST architecture.
go to post Jimmy Christian · Jun 3, 2019 Yep. Select INTO works great if the source and target tables are in same NAMESPACE. I need to copy the data across namespaces, for which i have already some another method. But i found that copying recordset would also work, since once the object is created i can easily write to another table on a different "NAMESPACE". Only issue is to write to a target table from a recordset i need to loop it and am not aware of a straightforward copy.
go to post Jimmy Christian · May 31, 2019 Thank you Robert. But looks like i am running into another issue where data is lost and i am unable to create table.I really would prefer to find out if there is a way to copy directly a RecordSet to a table or any other faster method rather than looping through the entire Recordset.
go to post Jimmy Christian · May 17, 2019 Vitaliy, This is great !The code works fine now. Appreciate your help and time.I have to put some filters on the columns now, which i think i have to use the QueryInfo Object.Thank you !Regards,Jimmy Christian.
go to post Jimmy Christian · May 17, 2019 Hello Vitaliy,Thank you for your time. This works good. Issue is that i only see the first page of the results.Even after adding the tableNavigatorBar, it still shows only one page and not all the results. I have more than 30,000 rows to display on the page. Let me know.Thanks,Jimmy
go to post Jimmy Christian · May 16, 2019 I cannot share globals on the namepsace i am working on.Actually i was able to retrieve data from Namespace2 working on a callback method for recordset which the table is using. But now issue is zenpage only shows the first page.Will try to find out a reason why the page is hanging. It could be that i have to flip back to Namespace1 once i get the recordset.Thanks.
go to post Jimmy Christian · May 14, 2019 Thanks Neerav.I am referring to the zenpage call back methods, which are called on a zenpage event.Problem is i cannot create any views in namespace2.
go to post Jimmy Christian · May 14, 2019 Thanks Neerav.I still believe we can do in the code by using a callback method. I am not sure how to use it.
go to post Jimmy Christian · May 8, 2019 Thanks John. This was helpful. I had to correct the password for that service.Issue is resolved.
go to post Jimmy Christian · Apr 23, 2019 Thank you . This is perfect !I just tweaked it little bitSET testingddl="CREATE TABLE xxxxxxx"_$USERNAME_"(TNAMESPACE CHAR(100),TINTERFACE CHAR(100),TPORT INT)"s ret=##class(%SQL.Statement).%ExecDirect(,.testingddl)
go to post Jimmy Christian · Apr 23, 2019 Thank you all. At this time, i will not be able to map the USER db to rest of it. But i will try to call support .
go to post Jimmy Christian · Apr 19, 2019 i Was able to resolve this by adding choice and display column attributes.