webservice - JAVA调用C#接口中文转码问题?
PHP中文网
PHP中文网 2017-04-18 10:08:09
0
0
652

请求都是UTF-8编码,但是传入后变成了0xe90xac0x8a0xe9[0xba],请问各位大神该如何处理?代码如下:
PostMethod postMethod = new PostMethod(wsdlLocation);

    String soapRequestData = buildRequestXmlData(patameterMap);
    byte[] bytes = soapRequestData.getBytes("utf-8");
    InputStream inputStream = new ByteArrayInputStream(bytes, 0, bytes.length);
    RequestEntity requestEntity = new InputStreamRequestEntity(inputStream, bytes.length,
            "application/soap+xml; charset=utf-8");
    postMethod.setRequestEntity(requestEntity);

    HttpClient httpClient = new HttpClient();
    int statusCode = httpClient.executeMethod(postMethod);
    soapResponseData = postMethod.getResponseBodyAsString();
PHP中文网
PHP中文网

认证高级PHP讲师

全部回覆(0)
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板