Oracle SOA Suite (MOSC)

MOSC Banner

Chinese Characters in Oracle Service Bus

in Oracle SOA Suite (MOSC) 2 commentsAnswered ✓

Hi All,

I am facing an issue when trying to convert XML to JSON in OSB with the names which are stored in Chinese in Oracle DB.

In XML Payload, it is coming as <name>北京文鼎拓达商贸有限公司</name>

When tried to convert from XML to JSON using NXSD translate, it was giving as binary-content which is further converted using below class-

Upon conversion, it is giving the JSON element as - "name" : "????????????"

Below is the class used to convert binary content-

package convertbinarytostring;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.io.ByteArrayInputStream;
import java.util.Arrays;
import java.util.Date;

public class ConvertBinaryToString {
    public static String decodeBinaryToText(byte[] encodedDataRef) {
        String decodedData = "";
        try {
            decodedData = new String(encodedDataRef);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("Error in conversion class");
        }
        return decodedData;
    }
}
Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center