Heim  >  Fragen und Antworten  >  Hauptteil

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 Tage vor635

Antworte allen(0)Ich werde antworten

Keine Antwort
  • StornierenAntwort