1. David Peace (Powersoft)
  2. PowerBuilder
  3. Monday, 23 December 2019 15:41 PM UTC

Hi Guys

I'm calling a web service that insists on returning encoding gzip chunked, if I change what we accept to anything else it errors. Considering that it is just returning a short string it's a bit OTT.

Anyway is there a way to decode this in PB? I tried writing the stuff as a blob to disk setting UTF8/16 as the encoding.

Any ideas?

David

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 23 December 2019 17:16 PM UTC
  2. PowerBuilder
  3. # 1

Hi David;

   GZip support was added to the RESTClient object class in PB 2019 GA, as follows (PB Help) ...

"If the response value is compressed as gzip, it will be automatically decompressed. Only gzip compression format is supported at this moment. If the server specified the Content-Type response header, and in which the encoding charset is specified, this function will encode the data with the specified charset, if charset is not specified, this function will encode the data in UTF-8 by default."

Regards ... Chris

Comment
  1. mike S
  2. Monday, 23 December 2019 17:18 PM UTC
even easier than i thought...
  1. Helpful
  1. David Peace (Powersoft)
  2. Monday, 23 December 2019 17:28 PM UTC
Cheers Chris, I'm not ready to use PB2019 until the R3 release. It quite anoying as there are so many great new things to play with :)
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 23 December 2019 19:06 PM UTC
Always a new "toy" coming under tree from Santa this time of year. ;-)

Happy holidays everyone!
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Monday, 23 December 2019 16:22 PM UTC
  2. PowerBuilder
  3. # 2

doesn't the extractor object do what you want?

objectname.Extract ( blob source, ref blob dest {, ArchiveFormat format })

 

 

Comment
  1. mike S
  2. Monday, 23 December 2019 17:17 PM UTC
its new in 2019.



I'm have no idea, but roland's zlib may decompress for you if you use the right options? http://www.topwizprogramming.com/freecode_zlibwapi.html
  1. Helpful
  1. David Peace (Powersoft)
  2. Monday, 23 December 2019 17:27 PM UTC
I'll take a look at that, roll on 2019R3.... so many new goodies in that version it's anoyng :)
  1. Helpful
  1. Roland Smith
  2. Monday, 23 December 2019 19:20 PM UTC
The zlibwapi.dll file exposes more gzip functions than I add code for to the n_zlib object. I haven't given gzip much thought. If you are able to decompress a gzip'd blob using zlibwapi, please let me know.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.