首页  >  问答  >  正文

webservice - JAVA调用C#接口中文转码问题?

请求都是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中文网2741 天前637

全部回复(0)我来回复

暂无回复
  • 取消回复