IBM MobileFirst Adapter响应包含垃圾字符

时间:2016-07-21 09:18:09

标签: web-services soap utf-8 mobilefirst-adapters mobilefirst-server

HTTP适配器响应JSON将阿拉伯字符显示为

  

ÙزارةآØ'ؤÙنأاØØØÙÙ...اعية

环境:

  1. IBM MobileFirst Platform 7.1.0.00.20160401-2103 [生产模式]
  2. WebSphere Application Server 8.5.5.5
  3. Java(TM)SE运行时环境(1.7.0_79-b15)
  4. 输入对象:

     {
        method : 'get',
        returnedContentType : 'xml',
        path : '/services.asmx'
    }
    

    响应:

        {
        "isSuccessful": true,
        "responseHeaders": {
            "Cache-Control": "private, max-age=0",
            "Content-Type": "text\/xml; charset=utf-8",
            "Vary": "Accept-Encoding",
            "X-AspNet-Version": "4.0.30319"
        },
        "statusCode": 200,
        "statusReason": "OK",
        "DataSet": {
            "diffgram": {
                "NewDataSet": {
                    "lock_org": [{
                        "FeesValue": "50",
                        "hasChanges": "inserted",
                        "id": "lock_org1",
                        "rowOrder": "0",
                        "lock_org_id": "1",
                        "lock_org_name_arb": "وزارة الشؤون الاجتماعية",
                        "lock_org_name_eng": "Ministry of Social Affairs"
                    }],
                    "xmlns": ""
                },
                "diffgr": "urn:schemas-microsoft-com:xml-diffgram-v1",
                "msdata": "urn:schemas-microsoft-com:xml-msdata"
            },
            "schema": {
                "element": {
                    "IsDataSet": "true",
                    "UseCurrentLocale": "true",
                    "name": "NewDataSet"
                },
                "id": "NewDataSet",
                "xmlns": "",
                "xs": "http:\/\/www.w3.org\/2001\/XMLSchema"
            },
            "xmlns": "http:\/\/tempuri.org\/"
        }}
    

    注意:
    在使用IBM MFP 7.1.0.00.20160513-1006

    的Eclipse Studio中,相同的实现可以正常工作

1 个答案:

答案 0 :(得分:0)

jvm.options下面的属性解决了这个问题:

-Duser.language=en
-Duser.country=US
-Dfile.encoding=UTF-8