64 To String Conversion

Hi All,

I’m encountering a new type of string while receiving records from source team only for one particular sender

Flow
The source team is sending data in JSON format, at wM we are converting JSONtoDocument and inserting records to DB, The exchange rate is of type string for all the values except for one as highlighted in attached screenshot

Could anyone please let me know how could we convert highlighted 64 to String

Please let me know if more information is required

wM Version - 9.7

Thanks,
Sagar
64.JPG

Even I did face this issue in one of the past projects.

make the dataType of exchangeRate to object and use pub.string:objectToString (I used this)

else you can try the below approaches

1> Ask the source system to send as String only
2> Use the WmTransformationServices pacake to convert integer/long to String.

To add, there are some settings to help you but these are global settings. I would recommend go with the above options and see what best suits you.

watt.server.json.decodeIntegerAsLong

Converts an integer that Integration Server retrieves from JSON content to either a
Long or Integer Java wrapper type. If this parameter is set to true, Integration Server
converts the JSON integer to a Long Java wrapper type. If this parameter is set to false,
Integration Server converts the JSON integer to a Integer Java wrapper type. The default
is true (Long).

watt.server.json.decodeRealAsDouble

Converts a real number that Integration Server retrieves from JSON content to either
a Float or Double Java wrapper type. If this parameter is set to true, Integration Server
converts the real number to a Double Java wrapper type. If this parameter is set to
false, Integration Server converts the real number to a Float Java wrapper type. The
default is true (Double).

watt.server.json.decodeRealAsString

Converts a real number that Integration Server retrieves from JSON content to String. If
this parameter is set to true, Integration Server converts the real number to a String. If
this parameter is set to false, Integration Server does not convert the real numbers to
String instead, real numbers are converted to either Float or Double Java wrapper type
depending on the values specified in decodeRealAsDouble . The default is false.

2 Likes

Hi Mahesh,

Thank you very much for your response, I tried using watt.server.json.decodeRealAsString = True, watt.server.json.decodeIntegerAsLong = False, watt.server.json.decodeRealAsDouble = False and was able to successfully retrieve the value in string format

Regards,
Sagar