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

请求都是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讲师

Antworte allen(0)
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage