Forum

May 6, 2026

Please or Register to create posts and topics.

JSON response from an RPG program running from Web service is Generating JSON strings with embedded quotes (\"),

while using YAJL -- Latest version.

JSON response from an RPG program running from Web service is Generating JSON strings with embedded quotes (\").

When viewed by SOAPUI looks like this:

{"PJSON_PAYLOAD": "{\"policyNumber\":9,\"recordCount\":0,\"success\":\"false\",\"message\":\"Invalid Call ID: 9\",\"batch_TimeStamp\":\"2026-06-12-17.46.08.515175\"}"}

During the debug session I look out the output and it looks like this:

{"PJSON_PAYLOAD": "{"policyNumber":9,"recordCount":0,"success":"false","message":"Invalid Call ID: 9","batch_TimeStamp":"2026-06-12-17.46.08.515175"}"}

Is there a web server option that I am not configuring correctly?

Thanks in advance

Angel

 

 

Short answer: no, this isn’t a web server config issue. It’s a classic double‑encoding / nested JSON string problem coming from your RPG code.

I've seen this when the values are not double quoted:

in RPG you might have payload = '{"policyNumber":9,"success":"false"}';

so the service builds { "PJSON_PAYLOAD": payload }

which becomes { "PJSON_PAYLOAD": "{\"policyNumber\":9,...}" }

 

Can you share the RPG line that is creating that payload? Or are you reading from IFS? Or is it dynamic from the webserver?

Jump to the Full IBM i Course Catalogue

>