Search found 74 matches

by tsupartono
Fri Mar 22, 2019 4:35 pm
Forum: Questions & Answers
Topic: #XPRIM_JsonObject
Replies: 2
Views: 1783

Re: #XPRIM_JsonObject

The XPRIM_JsonReader will not perform well when reading large amount of data, as it's an RDML library , as opposed to a native VL feature. Performance on IBM i is definitely worse than on Windows. My suggestion would be to try to use the native PRIM_JSON feature. You would need to write the response...
by tsupartono
Sat Feb 23, 2019 7:41 am
Forum: Questions & Answers
Topic: Webservice generation
Replies: 2
Views: 1468

Re: Webservice generation

Hi Dan, Just so you are aware, aXes has its own forum and you might get more replies if you post your question there. https://axes.lansa.com.au At the least, aXes does come with a set of Java and .NET API that let you navigate your screens and get/set fields on the screen programmatically . If you h...
by tsupartono
Thu Jan 31, 2019 5:53 pm
Forum: Questions & Answers
Topic: XPRIM_RandomAccessJsonReader and ReadStringWithName
Replies: 2
Views: 1637

Re: XPRIM_RandomAccessJsonReader and ReadStringWithName

Since the result property is under the operation object, I would imagine you would need to start from operation , followed by result ? #JsonRandomAccessReader.BeginObjectWithName( "operation" ) #JsonRandomAccessReader.BeginObjectWithName( "result" ) Or you can also do: #JsonRandomAccessReader.BeginO...
by tsupartono
Fri Nov 09, 2018 10:18 am
Forum: Questions & Answers
Topic: XPRIM_JSON
Replies: 2
Views: 1385

Re: XPRIM_JSON

Unfortunately not.
by tsupartono
Wed Oct 24, 2018 12:47 pm
Forum: Tips and Techniques
Topic: If you are writing/reading JSON for Web API Publishing.....
Replies: 0
Views: 10836

If you are writing/reading JSON for Web API Publishing.....

When writing/reading JSON in your server module for the purpose of publishing web services , make sure that you use the VL-native PRIM_JsonWriter and PRIM_JsonReader , instead of the XPRIM_JsonWriter and XPRIM_JsonReader (from the RDML Extended Library ). As PRIM_JsonWriter and PRIM_JsonReader are n...
by tsupartono
Mon Sep 10, 2018 1:24 pm
Forum: Questions & Answers
Topic: #XPRIM_HttpRequest & Base64
Replies: 2
Views: 1011

Re: #XPRIM_HttpRequest & Base64

The default memory allocation on IBM i is limited to 16M, so that may be your issue. We'll investigate to see if there is any way around this limitation. Note also that if you are writing/reading Base64-encoded file, don't encode/decode manually, as VL strings are limited to 64K - you won't get an e...
by tsupartono
Thu Sep 06, 2018 1:19 pm
Forum: Questions & Answers
Topic: JSON Reader for Nested Arrays
Replies: 2
Views: 917

Re: JSON Reader for Nested Arrays

Define_Com Class(#PRIM_DC.UnicodeString) Name(#County) For Each(#Component) In(#Reader.ReadArrayWithPath( 'results/1/address_components' )) If (#Component.Item<'types'>.ItemAt<1>.AsString = 'administrative_area_level_2') #County := #Component.Item<'long_name'>.AsString Leave Endif Endfor
by tsupartono
Tue Aug 21, 2018 11:51 am
Forum: Questions & Answers
Topic: Byte array
Replies: 2
Views: 1175

Re: Byte array

Can you explain more what you want to do?
Are you coding a client-side VL web page, or server-side (or Windows rich client)?
by tsupartono
Mon Aug 20, 2018 9:51 am
Forum: Questions & Answers
Topic: base64
Replies: 3
Views: 1516

Re: base64

Please find the usage example below.

Code: Select all

Define_Com Class(#XPRIM_Binary) Name(#Bin)

#Bin.FromStringUsingUTF8 String(#MyUserAndToken)
#EncodedToken := #Bin.AsBase64String
by tsupartono
Wed Jul 04, 2018 8:47 am
Forum: Questions & Answers
Topic: xDeviceFileWrite and VLWEB SP2
Replies: 1
Views: 816

Re: xDeviceFileWrite and VLWEB SP2

Have a look at the PRIM_WEB.BlobReader:

https://docs.lansa.com/14/en/lansa016/p ... reader.htm

--
by tsupartono
Mon Jun 18, 2018 9:36 am
Forum: Questions & Answers
Topic: WLWEB in Longrange Webview
Replies: 2
Views: 897

Re: WLWEB in Longrange Webview

I'm not sure if you had a chance to have a look at the last post in this thread - if not this may help you: https://longrange.lansa.com.au/viewtopic.php?f=11&t=610#p1858 If you have tried the suggestion in post above and it does not make any difference for you, I'd suggest you send the issue to Supp...
by tsupartono
Thu May 17, 2018 9:59 am
Forum: Questions & Answers
Topic: XPRIM_HTTPRequest vs CSV Data
Replies: 2
Views: 1113

Re: XPRIM_HTTPRequest vs CSV Data

The Response object has an AsFile method that would save the response to a file (you can then use TRANSFORM_FILE function to convert that to a list) Have a look at the documentation below for all the available options: https://docs.lansa.com/14/en/lansa015/index.htm#lansa/l4wtgu10_0135.htm See examp...
by tsupartono
Tue May 15, 2018 11:06 am
Forum: Questions & Answers
Topic: Json Reader Question
Replies: 3
Views: 1242

Re: Json Reader Question

For short arrays, the easiest would be this:

Code: Select all

For Each(#Item) In(#JsonReader.ReadArrayWithName( 'textPasted' ))
   * Process #Item
Endfor
by tsupartono
Thu Mar 15, 2018 10:41 am
Forum: Questions & Answers
Topic: Setfocus not working on LANSA Mobile
Replies: 14
Views: 4291

Re: Setfocus not working on LANSA Mobile

When you say it works on the browser, did you mean on your PC, or on iOS Safari on your phone?
by tsupartono
Fri Feb 16, 2018 5:01 pm
Forum: Questions & Answers
Topic: #XPRIM_HttpRequest
Replies: 9
Views: 2180

Re: #XPRIM_HttpRequest

The WAM runtime (part of the LANSA runtime) creates a file automatically for you when you use BLOB field ( EBMONJD ) to receive data, and my believe is that the file is always created with a fixed CCSID (possibly the default CCSID for the user profile), instead of using the Content-Type to determine...
by tsupartono
Fri Feb 16, 2018 4:07 pm
Forum: Questions & Answers
Topic: #XPRIM_HttpRequest
Replies: 9
Views: 2180

Re: #XPRIM_HttpRequest

This code below does not actually receive or create the file - it's just a utility function to get file size etc. #File := #EBMONJD If Cond(#File.Exists) #TMPPTHNAM := #EBMONJD.FileName // view file in IFS TMPPTHNAM Endif When you say that you receive the file, what's the mechanism? Do you use serve...
by tsupartono
Fri Feb 16, 2018 3:01 pm
Forum: Questions & Answers
Topic: #XPRIM_HttpRequest
Replies: 9
Views: 2180

Re: #XPRIM_HttpRequest

If you have to use STM_FILE_OPEN , then I think the best way is to determine first how to get the receiving WAM runtime to create the file with the correct CCSID (ie, 819 instead of 37). If the file is created with a correct CCSID, based on the way you describe it, STM_FILE should be able to read th...
by tsupartono
Fri Feb 16, 2018 12:42 pm
Forum: Questions & Answers
Topic: #XPRIM_HttpRequest
Replies: 9
Views: 2180

Re: #XPRIM_HttpRequest

Hi Muir, I don't believe that the WAM runtime checks the received Content-Type , so in this case the content would still be encoded in ASCII, but it seems that CCSID 37 was (incorrecty) applied when the file is created by the WAM runtime. Changing the Content-Type in the HTTP request is unlikely to ...
by tsupartono
Mon Feb 12, 2018 11:03 am
Forum: Questions & Answers
Topic: #XPRIM_Json Question
Replies: 5
Views: 1617

Re: #XPRIM_Json Question

HI Jim, Please see below a JsonReader example of parsing a JSON array containing objects like so: [ {"value": 1}, {"value": 2} . . . ] The example below uses SetSourceString to set the source string. Replace that with SetSourceHttpResponse if you are parsing a HTTP response data. Define_Com Class(#X...
by tsupartono
Mon Feb 05, 2018 4:37 pm
Forum: Questions & Answers
Topic: #XPRIM_HttpContentInfo
Replies: 2
Views: 1009

Re: #XPRIM_HttpContentInfo

Hi Jim, The documentation page for AddFile can be found in the LANSA Technical Reference . Here is the link to the section: http://docs.lansa.com/14/en/lansa015/index.htm#lansa/l4wtgu10_0260.htm The ContentInfo parameter is optional, so you don't have to specify it if you don't need to. Also - if th...