Problem with Thai characters in REST BC

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with Thai characters in REST BC

OpenESB Community Forum mailing list
Hello All,

I am trying a simple REST BC project where request and response is exact
same (Echo). While testing this project with I am facing the issue with
encoding. In request XML I have Thai characters and ESB is not able to
encode it properly which result in incomplete response message. Below is the
example ,

Request XML :
<DRIVERINFO><DRIVER FIRST_NAME="วารินทร์" LAST_NAME="อาดคเดช"
DRIVER_XID="3401900131031" DATE_OF_BIRTH="1076-11-16 08:00:00.0">        
         </DRIVER>
      </DRIVERINFO>
===========================================================================
Response XML :
<?xml version="1.0" encoding="UTF-8"?>
<DRIVERINFO>
    <DRIVER DATE_OF_BIRTH="1076-11-16 08:00:00.0" DRIVER_XID="3401900131031"
FIRST_NAME="วารินทร์" LAST_NAME="อาดคเดช">                
===========================================================================

I have also setup JVM parameter in OpenESB startup file as
-Dfile.encoding=UTF-8 but still it doesn't resolve the problem.

Did anyone face this issue ?

Note: With English characters the project is working fine.

Regards,
Akshay



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Thai characters in REST BC

Mike Phillips
What OS are you using. We had trouble in Solaris 10 until we set the
LANG=en_US.UTF-8 in the environment that
launched your ESB app.

On 12/19/2017 6:51 AM, Akshay13 via User wrote:

> Hello All,
>
> I am trying a simple REST BC project where request and response is exact
> same (Echo). While testing this project with I am facing the issue with
> encoding. In request XML I have Thai characters and ESB is not able to
> encode it properly which result in incomplete response message. Below is the
> example ,
>
> Request XML :
> <DRIVERINFO><DRIVER FIRST_NAME="วารินทร์" LAST_NAME="อาดคเดช"
> DRIVER_XID="3401900131031" DATE_OF_BIRTH="1076-11-16 08:00:00.0">
>           </DRIVER>
>        </DRIVERINFO>
> ===========================================================================
> Response XML :
> <?xml version="1.0" encoding="UTF-8"?>
> <DRIVERINFO>
>      <DRIVER DATE_OF_BIRTH="1076-11-16 08:00:00.0" DRIVER_XID="3401900131031"
> FIRST_NAME="วารินทร์" LAST_NAME="อาดคเดช">
> ===========================================================================
>
> I have also setup JVM parameter in OpenESB startup file as
> -Dfile.encoding=UTF-8 but still it doesn't resolve the problem.
>
> Did anyone face this issue ?
>
> Note: With English characters the project is working fine.
>
> Regards,
> Akshay
>
>
>
> --
> Sent from: http://openesb-community-forum.794670.n2.nabble.com/


Reply | Threaded
Open this post in threaded view
|

Re: Problem with Thai characters in REST BC

OpenESB Community Forum mailing list
Hello Mike,

I am running this on windows 10 machine.

Akshay



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Thai characters in REST BC

OpenESB Community Forum mailing list
In reply to this post by OpenESB Community Forum mailing list
Don't know if this will be a good solution for you, but you can write java
pojo encoder by yourself and add it to you project as external library. For
example I once expirienced same issue when I tried to read cyrillic
characters from xml, they were basicly in cp1251 encoding, so I have to get
string from bpel and transfer it to pojo method, then in java pojo method I
got this string bytes in cp1251(For Thai characters not sure but it can be
ISO-8859-1), then I encoded those bytes to UTF-8 and then I returned string
with UTF-8 characters.

Another solution is you can also write external pojo jbi module, which will
send post request and return answer if needed, in this case you have to
write custom wsdl and xsd scheme so you can invoke pojo module through your
bpel process. All manipulation with characters will be inside your pojo
module. Hope this helps. Excuse my english.




OpenESB Community Forum mailing list wrote

> Hello All,
>
> I am trying a simple REST BC project where request and response is exact
> same (Echo). While testing this project with I am facing the issue with
> encoding. In request XML I have Thai characters and ESB is not able to
> encode it properly which result in incomplete response message. Below is
> the
> example ,
>
> Request XML :
> <DRIVERINFO>
> <DRIVER FIRST_NAME="วารินทร์" LAST_NAME="อาดคเดช"
> DRIVER_XID="3401900131031" DATE_OF_BIRTH="1076-11-16 08:00:00.0">
>        
>          
> </DRIVER>
>      
> </DRIVERINFO>
> ===========================================================================
> Response XML :
> <?xml version="1.0" encoding="UTF-8"?>
> <DRIVERINFO>
>    
> <DRIVER DATE_OF_BIRTH="1076-11-16 08:00:00.0" DRIVER_XID="3401900131031"
> FIRST_NAME="วารินทร์" LAST_NAME="อาดคเดช">
>                  
> ===========================================================================
>
> I have also setup JVM parameter in OpenESB startup file as
> -Dfile.encoding=UTF-8 but still it doesn't resolve the problem.
>
> Did anyone face this issue ?
>
> Note: With English characters the project is working fine.
>
> Regards,
> Akshay
>
>
>
> --
> Sent from: http://openesb-community-forum.794670.n2.nabble.com/





--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/