Guys, I found an interesting point. Since my SOAP server is using iso-8859-1, and the xml it sends do set the encoding to iso-8859-1, the
(OMElement) response.getXMLStreamReader().getCharacterEncodingScheme() method should print the string "ISO-8859-1", but it is printin "utf-8".
I think this proves the axis2 libraries will interpret the bytes read from the network as UTF-8 instead of ISO-8859-1, doesn't it?
Bellow is an example of the SOAP response my SOAP server is sending to me (I used tcpmon to get this text)
HTTP/1.0 200 OK
Content-length: 1269
<?xml version="1.0" encoding="iso-8859-1"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AgendaPesquisa>
<status>0</status>
<ListaContatosPesquisa>
<tipo>C</tipo>
<dono>lucia</dono>
<posicao>177</posicao>
<nome>Abricó Gimarães</nome> <==NOTE: NON-ASCII CHARACTERS ARE CORRECT
<email></email>
</ListaContatosPesquisa>
</AgendaPesquisa>
</soap:Body>
</soap:Envelope>
Bellow is the code snippet from the method where I call ServiceClient.sendReceive() to get the response OMElement.
private OMElement doSoap(String methodName, OMElement method) throws AxisFault {
final EndpointReference targetEPR = new EndpointReference(planetfoneURL + "/pfappspabxutils");
ServiceClient client = new ServiceClient();
Options options = new Options();
options.setTo(targetEPR);
options.setAction(planetfoneURL + "/" + methodName + "#" + methodName);
options.setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED,org.apache.axis2.Constants.VALUE_FALSE
);
options.setProperty("CHARACTER_SET_ENCODING", "ISO-8859-1");
client.setOptions(options);
OMElement response;
response = client.sendReceive(method);
//DEBUG
System.out.println(response.getXMLStreamReader().getCharacterEncodingScheme());
//END DEBUG
return response;
}
Is axis2 ignoring that my server is sending iso-8859-1 data?
thank you,
bruno.
- Re: Converting from UTF-8 to ISO-8859-I with Axis2 and Ja... Bruno Negrao
- RE: Converting from UTF-8 to ISO-8859-I with Axis2 a... Brennan Spies
- Re: Converting from UTF-8 to ISO-8859-I with Axi... Bruno Negrao
- RE: Converting from UTF-8 to ISO-8859-I with Axi... Brennan Spies
- Re: Converting from UTF-8 to ISO-8859-I with Axis2 a... Manuel Mall
- Re: Converting from UTF-8 to ISO-8859-I with Axi... Bruno Negrao
- Re: Converting from UTF-8 to ISO-8859-I with... Manuel Mall
- Re: Converting from UTF-8 to ISO-8859-I ... Davanum Srinivas
- Re: Converting from UTF-8 to ISO-88... Davanum Srinivas
- Re: Converting from UTF-8 to IS... Bruno Negrao
- Re: Converting from UTF-8 t... Davanum Srinivas
