cancel
Showing results for 
Search instead for 
Did you mean: 

Missing Double Quotes in JSON format for Receiver Rest Adapter

former_member188353
Participant
0 Kudos

Hi Team,

I'm working (PI 7.31 SP 20) on one scenario from Proxy to Rest, converting XML to JSON format.

Here i'm facing issue like we are not getting the double quotes for some field values where as getting double quotes for some values. because of this my request is failing at REST end.

Customer is asking to send one particular field in Double Quotes to overcome this issue(they are not expecting the double quotes for all fields).

Now i'm getting like this : "po_number":12345,"organization":9000,

Even i had tried with small UDF, but if i used this UDF i'm getting Double Quotes twice in JSON

UDF: return var1 = "''" + var1 + "''" ;

Result with the above UDF: "po_number":""12345"","organization":""9000"", which is not correct.

Now how can i pass a particular field value in double quotes. ?

My Requirement: "po_number":"12345","organization":"9000",


Regards,
P R.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Manoj,

I have an issue with double quotes in my JSON payload in other way around.

We have a scenario to send a RAW text to REST service to obtain the session ID

As REST adapter supports unstructured text, we checked the boxes in REST adapter Data Format tab:-

Strip operation from the message,

Strip outer element

When we do the above we are getting the text payload with double quotes
"username=+++++++++&password=+++++++++++"

Without double quotes (") if we trigger it will work, but we are unable to remove those double quotes in PI

I hope you can help me to remove this double quotes using some functions.

Reiterating the issue:-

PI is sending the string with double quotes,but we don't want the double quotes

As we are passing string in the field, but we are looking for an option to remove "" (double quotes) when we send as an unstructured text

for example:

now = "username=+++++++++&password=+++++++++++" (we want an option to remove the double quotes (""))

expected as = username=+++++++++&password=+++++++++++

Regards

0 Kudos

Hi Nikita,

Are you able to solve this issue. We have the same issue. Can you share how you are able to solve this? We don't want to go for Java/xslt mapping for this.

Thanks Venkat

former_member188353
Participant
0 Kudos

Hi Manoj,

Thanks for the reply.

but i don't see such Custom XML/JSON Conversion Rules option in Rest Receiver Channel. I'm using PI 7.31 SP 20.

Can you please help me that where i can update the details in my version or any another way to resolve my issue?

BR,
P R.

manoj_khavatkopp
Active Contributor
0 Kudos

The field which you want in double quote has to be mentioned in REST channel as type string.