on 10-08-2015 7:18 AM
Dear All,
We are facing a problem in Processing special characters (western european .e.g. À, È, Ì, Ò, Ù). PFB the scenario details:
PI Version: 7.4 Single Stack, SP 09
Scenario: We are reading a fixed length file and by using Java Mapping we are inserting data in to 4 tables in target DB.
SFTP(Fixed length file)--> Java Mapping (1:4 multimapping with 4 different interfaces and 1 single receiver)-->JDBC receiver
Issue Description: We are facing issue while processing special characters, as mentioned above. These special characters were getting distorted. As per our understanding, this problem is due to character encoding and can be broken into following parts:
1. Inbound Message via SFTP: This has been addressed by using MessageTransformationBean and setting Transform.ContentType parameter as shown below:
After above setting, the Inbound message to PI is coming properly without any distortion.
2. Java Mapping: In Java mapping we have set the encoding at two places:
a) Encoding change for output stream:
out.getOutputPayload().getOutputStream().write(new String(OpString).getBytes("ISO-8859-1"));
b) Encoding for XML Message Structure: By setting
<?xml version="1.0" encoding="ISO-8859-1" ?>
After above changes the mapping is able to process special characters and mapping output structure is as follows:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<ns1: MT_TargetMessageType2 xmlns:ns1="targetnamespace">....</ns1: MT_TargetMessageType2>
</ns0:Message1>
<ns0:Message3>
<ns1: MT_TargetMessageType3 xmlns:ns1="targetnamespace">....</ns1: MT_TargetMessageType3>
</ns0:Message3>
<ns0:Message4>
<ns1: MT_TargetMessageType4 xmlns:ns1="targetnamespace">....</ns1: MT_TargetMessageType4>
</ns0:Message4>
<?xml version="1.0" encoding="UTF-8" ?>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
Thanks for your response!
This has already been done as mentioned in Part 2 in Issue Description.
PI takes output of Java mapping (which is multi-mapping) and does the message split and after message split individual messages are having encoding UTF-8. Not sure how to change this encoding from UTF-8 to ISO-8859-1 after message split as this split happens at runtime after message mapping.
Is there a way to influence this behaviour without impacting any other interface?
Thanks,
Rahul
Hello Rahul,
In the Operation Mapping did you put this Java mapping before the Multimapping. I guess it should work. Since your passing the encoded input to multimapping.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.