web服务-IBM MobileFirst适配器响应包含垃圾字符



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

ÙŞ

环境:

  1. IBM MobileFirst平台7.1.0.00.20160401-2103[生产模式]
  2. WebSphere Application Server 8.5.5.5
  3. Java(TM)SE运行时环境(1.7.0_79-b15)

输入对象:

 {
    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/"
    }}

注意:
同样的实现在Eclipse Studio中与IBM MFP 7.1.0.00.20160513-1006 配合使用效果良好

jvm中的以下属性。选项解决了这个问题:
-Duser.language=en
-Duser.country=US
-Dfile.encoding=UTF-8

最新更新