I actually have the SOAP request in a String object (this is only for testing). I submit this SOAP request using a HttpURLConnection object by setting all the required properties like request method, Content-Length, SOAPAction, etc. Then the SOAP request is written to the connection object's output stream. Here is the code snippet of the same:-
// write the post vars (the request string).
stream.write(request.getBytes("UTF-8"));
stream.flush();
stream.close(); // close the stream.
From the initial post, I continued my debugging and tried to deserialise the SOAP response (posted earlier) using DOM parser. I was able to retrieve the Russian text, but not all characters. The actual Russian text is "Сибирь/Дальний восток". But using DOM parser the retrieved Russian text is "Сибирь/Дальний во�?ток". So as can be seen one of the character is not rendered correctly.
~Guru
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35257
7
posted
0
Is the character transferred correctly, and just not displayed correctly wherever the code is displaying it? Or is it incorrect within the SOAP as well?
I believe the characters should be getting transfered correctly. I was able to successfully retrieve the Russian characters using a Axis WSDL2Java client.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35257
7
posted
0
In that case, where are you seeing the incorrect character? How are you getting the characters from the SOAP response, and how are you displaying them?
Guru Rao
Greenhorn
Joined: Apr 24, 2009
Posts: 11
posted
0
As mentioned in my 2nd post in this thread, I post a SOAP request to the HttpURLConnection object. The response is deserialised using DOM parser and the Russian characters are written to a file. I open this file in a Unicode enabled text editor (like edit plus) and check for the Russian characters.
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12271
1
posted
0
Russian characters are written to a file
Writing a String to a file involves an implicit character encoding - probably the default on your machine.
If this was my problem I would consider dumping the captured string one character at a time as int values to see if the internal Unicode corresponds to the expected Russion characters.
Bill
Guru Rao
Greenhorn
Joined: Apr 24, 2009
Posts: 11
posted
0
I tried writing as char[] as well as byte[], but was not able to retrieve the russian characters successfully.
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12271
1
posted
0
Did you look at the int (or hex) value of the Unicode characters in memory to see if they are getting that far intact.