On Wednesday 01 November 2006 12:40, Bruno Negrao wrote:
> 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)

Bruno,

encoding issues in my experience can be very tricky to debug. Never
 rely on any characters you see on the screen or in print to figure out
 the actual encoding used. The tool which displays / prints may have
 weaved its own encoding/decoding 'magic' and may show you distorted
 results. Look at the actual byte stream and check how the characters
 are actually encoded in it, i.e. how does the message appear 'on the
 wire'.

Manuel

> 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/
> <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.
>CHU NKED,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().getCharacterEncoding
>Sch eme());
>         //END DEBUG
>         return response;
>     }
>
>
> Is axis2 ignoring that my server is sending iso-8859-1 data?
>
> thank you,
> bruno.

-------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to