1. Yerva Sai Ritu
  2. PowerBuilder
  3. Wednesday, 25 September 2019 12:11 PM UTC
Hello ALL,
We are migrating PB9 application in PB2017R3. We are facing on issue while calling to restful services.
This code is working fine in PB9 but not working PB2017R3.
Sample code:
li_retrn = linet_base.PostURL(ls_url, lblb_args, ls_headers,long(gs_env_port),luo_http_post)
While call service in PB17 we getting junk value like (㔹〰‶†††††††….) in luo_http_post.return_parameter.

It seem like some missing file in source code environment please suggest.
Attachments (1)
Richard Keller Accepted Answer Pending Moderation
  1. Tuesday, 1 October 2019 22:58 PM UTC
  2. PowerBuilder
  3. # 1

You might also want to watch out for encoding in the header.   Many webservices return gzip and other compression which are handled naturally by some applications such as postman and IE Browser.   

Comment
  1. David Peace (Powersoft)
  2. Wednesday, 2 October 2019 14:55 PM UTC
Good point.
  1. Helpful
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Tuesday, 1 October 2019 21:41 PM UTC
  2. PowerBuilder
  3. # 2

You should also update your code to use HTTPClient, RESTClient or OAUTHClient to make the call.  The new objects are much more robust than the inet object.

 

Just my $.02

Kevin

Comment
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Wednesday, 25 September 2019 13:26 PM UTC
  2. PowerBuilder
  3. # 3

I agree with Roland, this is most likely a Unicode issue. The webservice is most likely expecting ANSI formatted strings and blobs. By default the later version of PB will use 2 bytes per character rather that the older 1 byte per character. Specifying Ansi encoding will fix this.

Cheers

David

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 25 September 2019 12:50 PM UTC
  2. PowerBuilder
  3. # 4

PB9 and older use Ansi strings (1 byte per character) while PB10 and higher use Unicode strings (2 bytes per character).

Try adding ,EncodingAnsi! to calls to String() & Blob() when converting between string and blob.

 

Comment
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.