NetTalk Central

Author Topic: WebService Response  (Read 7686 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
WebService Response
« on: September 05, 2019, 11:23:36 AM »
Hi, I need to send the response without <13,10>, like:

{"CODRTN":"00","SALDOS":"000001958935100","SIGNO1":"+","SACTU":"000001958935100","SIGNO2":"+","DOCUM":"000000880000107","LOCAL":"000000055100107","CANEXT":"000"}

How to do it?
-----------
Regards
Alberto

Matthew51

  • Full Member
  • ***
  • Posts: 152
    • View Profile
    • Email
Re: WebService Response
« Reply #1 on: September 05, 2019, 12:45:22 PM »
In the NetWebServiceMethod, Return tab. Change "Format return for" to Compactness.
Contractor with 10+ years of NetTalk experience looking for work.
www.linkedin.com/in/matthew-leavitt
BisWare.ca
Check out my free EasyTime Template

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: WebService Response
« Reply #2 on: September 05, 2019, 02:47:02 PM »
Thanks, another one...

Im ask to response with a width of 869 chars
I have two values that are strings and may have trailing spaces and I need to send this spaces to keep the width but the values in the json response are clipped
how can I do it?
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: WebService Response
« Reply #3 on: September 05, 2019, 05:54:27 PM »
>>I'm ask to response with a width of 869 chars

Where do you find these sorts of ridiculous requirements? :)
this is "just wrong"..... in so many ways...

yes, your response is going to get clipped. Yes, JSON has a variable length....
I guess put a . at the end of the response string or something like that?

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: WebService Response
« Reply #4 on: September 06, 2019, 04:38:53 AM »
It is a requeriment from an ATM system to validate the credit of a client.
Will try if they accept a dot at the end.
-----------
Regards
Alberto

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
Re: WebService Response
« Reply #5 on: September 06, 2019, 07:10:17 AM »
It is a requeriment from an ATM system to validate the credit of a client.
Will try if they accept a dot at the end.

Alberto,

in HTML there is a "non-breaking space" to force a space character.
This in needed sometimes, like >                       < here because the browser reduces the number of spaces between two characters, like between two words, no matter how many spaces you have added into your source.

For this &nbsp; is used. It has its equivalent on &#160; and perhaps it could work for you by filling the end of your string with this garbage?

This is it how the line above looks like, what the browser returns:
This in needed sometimes, like &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt; here because.......


Just a wild guess from me.....
Wolfgang
« Last Edit: September 06, 2019, 07:13:24 AM by Wolfgang Orth »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: WebService Response
« Reply #6 on: September 07, 2019, 10:45:01 PM »
Wolfgang, this is JSON not HTML, so &nbsp; does not apply.

cheers
Bruce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: WebService Response
« Reply #7 on: September 07, 2019, 10:46:04 PM »
Alberto, your best bet may be to put the JSON into a StringTheory object, then pad it out to the length you want.

Then return the StringTheory object.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: WebService Response
« Reply #8 on: September 08, 2019, 04:44:16 AM »
Thanks Bruce, Ive add a <160> to the string before the json is made and then a packet.replace after and it works ok.

By the way... had you seen my post about: "Problem when syncing spanish caracters:" ?
« Last Edit: September 08, 2019, 04:46:04 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: WebService Response
« Reply #9 on: September 08, 2019, 06:44:50 PM »
yes, I've seen the post, but I can only investigate that in the office tomorrow.