Page 1 of 1

Any way to dump posted data without specific reference?

Posted: Wed Feb 04, 2015 2:09 am
by jabain
Hi All,

Using LongRange LANSA RDMLX / V7R1 / IOS8 / Online

Is there any way to dump all the iPad screen data available to your program after a the iPad returns control to your program? It would greatly help in debugging when building new code and not getting expected results.
I may be incorrect on my understanding of the Architecture, but I assume that when you click a button on the iPad, it does an HTTP post with all the data to the server. The data is then available for retrieval with the Get_TextBox and other Get commands. The problem is that sometimes we may have the path to the data in the get command incorrect.
Having a way to dump would be a great aid to debugging.

E.g. In PHP there is a print_r() command which gives a dump like the one below.
<pre>
Array
(
[a] => apple
=> banana
[c] => Array
(
[0] => x
[1] => y
[2] => z
)
)
</pre>

Re: Any way to dump posted data without specific reference?

Posted: Wed Feb 04, 2015 9:02 am
by MarkDuignan
You could try turning on server side tracing (On client device -> Settings -> Troubleshooting and Support -> Server side logging – turn System Level on).
If you cannot turn tracing on then you will need to specifically enable it.

The trace should dump out all the name-value pairs arriving at the server.
The name-value pairs are what drives the LongRange engine and possibly what you are looking for.
The names map to the names you use in your code in a fairly straightforward and predictable.
There is a lot of data usually – but the ones to look for in an arriving set of data are like:
InsertNameValuePair -->|Inserted|.FORM.FIELDS.F004005.VALUE|aGVsbG8gc2FpbG9y
Which is the arriving property Form.Fields.F004005.Value. The value “aGVsbG8gc2FpbG9y” is base 64 encoded, but easy to decode using a site like https://www.base64decode.org/ to “hello sailor”.

A system dump shows the LongRange 'interpretation' of the arriving data.
If you wanted something more low level you could look at using Fiddler on your PC. See http://docs.telerik.com/fiddler/configu ... allFiddler
There are many articles available on how to configure your PC to acts a proxy for your IOS device. [url]Eg: http://docs.telerik.com/fiddler/configu ... gureForiOS[/url]

Re: Any way to dump posted data without specific reference?

Posted: Thu Feb 05, 2015 1:38 am
by jabain
Thanks Mark,

Sounds like the trace will work for me. I will try that out.

I thought about fiddler in the past, but the network that I am in is complex, and I have had difficulty in the past with getting the ports opened on firewalls/vpn's/etc to get this to work. It works great for web development when the client and fiddler are on the same machine.

Regards,

Andy

Re: Any way to dump posted data without specific reference?

Posted: Thu Feb 05, 2015 1:56 am
by jabain
Hi Mark,

The client will not let me turn on server side tracing.

I tried adjusting the client.xml file as specified in the docs, but it is still not working.

I am not sure what you meant below by "Specifically enable it".

Will the #COM_OWNER.AppTraceOn in the code give the same level of tracing?

Andy

Re: Any way to dump posted data without specific reference?

Posted: Thu Feb 05, 2015 9:21 am
by MarkDuignan
When you say it won't work - do you mean (1) - that you cannot turn the option on at the client device, or (2) that no trace files appear when the option is turned on?

Yes, that is what I meant by specifically enabling it. It is disabled by default as a security measures.

An application level trace will not trace the same deep system details.

You can programmatically turn system tracing on/off in the same way that you can turn application level tracing on/off.

However - if your problem is (2) then the files may still not appear (eg: you are not authorized to write a file to the IFS trace folder).

Re: Any way to dump posted data without specific reference?

Posted: Thu Feb 05, 2015 10:16 am
by Paul
Andy, just a thought but did you refresh the schema after you changed the Client.xml file?

In any case to turn on System tracing programmatically use the following...

Code: Select all

#COM_OWNER.SystemTraceOn
And off use......

Code: Select all

#COM_OWNER.SystemTraceOff
However, you really need client tracing to work because your server program would have already started when you try to turn system tracing on.

I hope this helps.

Re: Any way to dump posted data without specific reference?

Posted: Thu Feb 05, 2015 3:28 pm
by jabain
Hi Mark and Paul,

You were right. I needed to reload my schema, and now it allows me to turn on the tracing from the client side.

I found the system trace files and they are quite verbose and cryptic, however, they will suit my needs. I can search for a field by name, and can verify the full path, and value returned.

Thanks for the assistance.

Andy