1
Programming / Re: accept-encoding gzip issue with call "*plus/web/request"
« Last post by Stéphane Devouard on Today at 04:50:55 AM »Cedric
Here is the code I use on Linux to ungzip content returned by some APIs we're working with :
Hope this helps
Here is the code I use on Linux to ungzip content returned by some APIs we're working with :
Code: [Select]
0780 UNGZIP:
0790 ENTER (GZIPPED$)
0800 !
0810 UNGZIPPED$=""
0820 !
0830 GZFILE$="/tmp/pvx/TEMP."+FID(0)+"."+DTE(0:"YYYYMMDD.%Hz%mz%sz")+".gzip"
0840 OPEN CREATE PURGE (HFN,ISZ=-1,ERR=*NEXT)GZFILE$
0850 IF TCB(2)=1 THEN RETURN ""
0860 WRITE RECORD (LFO,SIZ=LEN(GZIPPED$),ERR=*NEXT)GZIPPED$; GZIPPED$=""
0870 CLOSE (LFO)
0880 FOR (GZIPPED$="")
0890 OPEN (HFN,ERR=*BREAK)"<cat "+GZFILE$+"|gzip -d"
0900 UNGZIPPED$+=RCD(LFO,END=*NEXT); GOTO *SAME
0910 CLOSE (LFO)
0920 ERASE GZFILE$,ERR=*NEXT
0930 NEXT
0940 !
0950 RETURN UNGZIPPED$
Hope this helps
2
Programming / Re: accept-encoding gzip issue with call "*plus/web/request"
« Last post by Mike King on May 10, 2024, 04:25:24 PM »Glad to hear you got it to work.
Perhaps the data is nt only gzip'ed but also Base64 encoded which would be common where binary data, such as what would be in the zipped contents, is involved.
Perhaps the data is nt only gzip'ed but also Base64 encoded which would be common where binary data, such as what would be in the zipped contents, is involved.
3
Programming / Re: accept-encoding gzip issue with call "*plus/web/request"
« Last post by Cedric on May 10, 2024, 11:04:26 AM »Thanks Mike, the info is helpful, but unfortunately the UCP solution throws an error 46.
I've tried with prefix, without, with other like $01$, $02$, etc... Always the same...
I'm thinking it may be related to the error 29 I'm getting while trying to simply print the data to screen.
Anyway, for now, I was able to reach out to the server admin so that I can receive the data uncompressed.
thanks
I've tried with prefix, without, with other like $01$, $02$, etc... Always the same...
I'm thinking it may be related to the error 29 I'm getting while trying to simply print the data to screen.
Anyway, for now, I was able to reach out to the server admin so that I can receive the data uncompressed.
thanks
4
Programming / Re: accept-encoding gzip issue with call "*plus/web/request"
« Last post by Mike King on May 10, 2024, 08:26:37 AM »Further info...
If you need to decompress data in a response prefix the data with a $00$ then pass it to the UCP function.
See https://manual.pvxplus.com/PXPLUS/functions/ucp.htm for details
If you need to decompress data in a response prefix the data with a $00$ then pass it to the UCP function.
See https://manual.pvxplus.com/PXPLUS/functions/ucp.htm for details
5
Programming / Re: accept-encoding gzip issue with call "*plus/web/request"
« Last post by Mike King on May 10, 2024, 12:21:30 AM »If you need to provide the content type to the request you can pass it in as the fifth parameter to *plis/web/request.
See https://manual.pvxplus.com/PXPLUS/Web%20Services/Overview.htm#submitting
To compress data use the CMP() function and strip the first byte as per the manual.
See https://manual.pvxplus.com/PXPLUS/Web%20Services/Overview.htm#submitting
To compress data use the CMP() function and strip the first byte as per the manual.
6
ODBC / Re: ODBC with latest MS Excel
« Last post by Mike Hatfield on May 09, 2024, 05:29:31 PM »Hi Devon & Tom,
I see that you found the same solution as I did.
Thanks to all for the responses
I see that you found the same solution as I did.
Thanks to all for the responses
7
Programming / accept-encoding gzip issue with call "*plus/web/request"
« Last post by Cedric on May 09, 2024, 04:30:25 PM »Hi, I would like to report 1 issue that I have juste encountered:
Unable to read compressed data like gzip for example. Normally, I would specify in the header "accept-encoding: none" and it would result in a non compressed response, but on this particular server, it seems they force the response in gzip no matter what I do. So, now I have to figure out how to handle this in PVX!
Unable to read compressed data like gzip for example. Normally, I would specify in the header "accept-encoding: none" and it would result in a non compressed response, but on this particular server, it seems they force the response in gzip no matter what I do. So, now I have to figure out how to handle this in PVX!
8
ODBC / Re: ODBC with latest MS Excel
« Last post by Tom Anderson on May 09, 2024, 03:44:56 PM »I see that MS Excel - Data - Get Data - Other Sources- MS Query has disappeared from the latest version of Excel.
How do we now run PxPlus ODBC ?
Thanks
Mike,
This worked for us:
https://answers.microsoft.com/en-us/msoffice/forum/all/the-excel-microsoft-query-menu-option-has/33158d52-6d06-46a9-b848-9656d9957671
Tom Anderson
9
Nomads / Re: numeric data in grid cells: how to round?
« Last post by James Zukowski on May 09, 2024, 03:34:19 PM »As a possibility, you could enable it before the load and disable it immediately after. That would minimize the potential crash time.
10
Nomads / Re: numeric data in grid cells: how to round?
« Last post by PMM_CAI on May 09, 2024, 03:17:44 PM »Thanks James. 'RI' did the trick, although we haven't decided about using it yet, since we don't want the behavior to be used elsewhere, and we might not want to risk turning it on in the pgm and then aborting out before turning it back off. But we are considering it! Thanks again.
Paula McKeever
CAI Software LLC
Paula McKeever
CAI Software LLC