Home » SQL & PL/SQL » SQL & PL/SQL » Multi-Language Charachters & XML Error! (Oracle 10g)
Multi-Language Charachters & XML Error! [message #439037] Wed, 13 January 2010 12:42 Go to next message
absolute_a2007
Messages: 3
Registered: January 2010
Junior Member
I have an Oracle procedure which interacts with a Web Service using SOAP Architecture.

Interact with WebService using UTL_HTTP Package.

While Interacting with Web Service and passing Multi-Byte Charachters example: (À Á Å Ä Ê Ë Ì Ð Ò Õ Ö Ù Û Ý á í ý ÿ)
in XML request I am getting error:

"org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence."

Please let me know if there is a way to resolve this XML error.

Here is the XML Code generated by my Oracle procedure:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<UName xmlns="">Tim  Änude </UName>
<checkInDate xmlns="">12/12/2009</checkInDate>
</soapenv:Body>
</soapenv:Envelope>



Please suggest how I can fix it in Oracle PL SQL Procedure?

Re: Multi-Language Charachters & XML Error! [message #439038 is a reply to message #439037] Wed, 13 January 2010 12:44 Go to previous messageGo to next message
BlackSwan
Messages: 24905
Registered: January 2009
Senior Member
>Please suggest how I can fix it in Oracle PL SQL Procedure?

most folks, including me, can't debug code we can not see.

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: Multi-Language Charachters & XML Error! [message #439056 is a reply to message #439037] Wed, 13 January 2010 16:35 Go to previous messageGo to next message
Kevin Meade
Messages: 2098
Registered: December 1999
Location: Connecticut USA
Senior Member
I think maybe he was asking for an explanation of the error.

Unfortunately there are few people who have experience in this area. Your best bet may be to do a google and look for some info. I did, looks like there is lots of people talking about it.

In general the error is telling you that your xml parser is expecting input to be in utf-8 format but there are one of more characters that in your input stream that are not allowed in utf-8 character set.

Good luck, Kevin
Re: Multi-Language Charachters & XML Error! [message #439061 is a reply to message #439056] Wed, 13 January 2010 22:28 Go to previous messageGo to next message
BlackSwan
Messages: 24905
Registered: January 2009
Senior Member
http://dev.openmrs.org/ticket/416
Re: Multi-Language Charachters & XML Error! [message #439070 is a reply to message #439037] Thu, 14 January 2010 00:09 Go to previous messageGo to next message
absolute_a2007
Messages: 3
Registered: January 2010
Junior Member
Thanks Kevin and Black Swan.

As you have correctly identified the XML for Web Service is looking for UTF-8 encoding.

My concern is it is already is UTF-8.

I have found a function which strips the UTF-8 Characters but I do not want to use it.

On google i couldn't find much related to Oracle.

Any other suggestion so that the 2-Byte error doesn't comes... any kind of string manipulation i can do here ?
Re: Multi-Language Charachters & XML Error! [message #439071 is a reply to message #439037] Thu, 14 January 2010 00:38 Go to previous messageGo to next message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
I think this is JAVA error :- me new to this area but done some searching for you on Google Check following link


Invalid byte 2 of 2-byte UTF-8 sequence
Re: Multi-Language Charachters & XML Error! [message #439086 is a reply to message #439037] Thu, 14 January 2010 02:58 Go to previous messageGo to next message
absolute_a2007
Messages: 3
Registered: January 2010
Junior Member
Hi All,

I got the answer....

The xml soap request doesn't accepts UTF-8 characters ( which are in 2Bytes), we need to convert it in plsql to ASCII Super sets

here is the statement i used to convert it and it worked perfectly for me:

SQL> SELECT CONVERT('Ä Ê Í Ó Ø A B C D E','UTF8','WE8ISO8859P1')
  2  FROM dual;

CONVERT('ÄÊÍÓØABCDE','UTF8','W
----------------------------------
ÿ ÿ Í ÿ ÿ A B C D E

SQL> -- the converted string can be passed to xml


Thanks

Ankit Vaid
Re: Multi-Language Charachters & XML Error! [message #439117 is a reply to message #439037] Thu, 14 January 2010 07:20 Go to previous message
Kevin Meade
Messages: 2098
Registered: December 1999
Location: Connecticut USA
Senior Member
Nice work man. Thank you also for taking the time to post your solution. This is what makes OraFaq really work.

Kevin
Previous Topic: Trigger Error
Next Topic: Join problem, need workaround
Goto Forum:
  


Current Time: Mon Sep 26 14:31:28 CDT 2016

Total time taken to generate the page: 0.11492 seconds