cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Rest: Invalid white space character (0x1a) Error

0 Kudos
4,590

Hi Experts,

While performing testing <Proxy to Rest> synchronous scenario, i am getting escape characters in response payload which causing the below error.

MP: exception caught with cause java.lang.RuntimeException: com.ctc.wstx.exc.WstxIOException: Invalid white space character (0x1a) in text to output (in xml 1.1, could output as a character entity)

Could you please suggest, how to handle the scenario.

Regards,

Manoj Kumar

Accepted Solutions (1)

Accepted Solutions (1)

former_member664177
Discoverer
0 Kudos

Hi Manoj,

Please check the below mentioned checkbox in REST channel and this should fix the issue.

0 Kudos

Hi Divyendu,

It resolved the issue.

Regards,

Manoj Kumar

Answers (2)

Answers (2)

JaySchwendemann
Active Contributor

Assuming you have PI and use Axis adapter: You would probably need to make sure either the sender will not send this whitespace or you will need to clean things beforehand, e.g. with a java mapping?

Cheers

Jens

khusal810
Active Participant
0 Kudos

Where exactly are you getting this white space?

It is inside some feild?

0 Kudos

Hi Khusal,

In response payload, one of the field contains the special characters.

Regards,

manoj Kumar

khusal810
Active Participant
0 Kudos

Hi Manoj,

Is the whitespace needed at the reciever end is one thing you need to see.

Depending on this there can be 3 solutions to this.

Please check whichever works fine for you.

  1. Ask the sender to trim the whitespace itself.
  2. Use JAVA mapping before message mapping to trim the feild or enclose the same in <CDATA> TAG
  3. Use graphical mapping to enclose the field in <CDATA> TAG.

Regards,

Khusal.

0 Kudos

Hi Kushal,

It required at receiver system side and confirmed it has to handle in PI side.

i am getting, JSON file as response from receiver system where REST adapter unable to convert it to XML file due to Special characters.

Regards,

Manoj Kumar

khusal810
Active Participant
0 Kudos

Hi Manoj,

I would suggest developing a JAVA mapping for converting JSON to XML,

when you are converting that particular field add <!CDATA> Tag for the same.