2 Replies Latest reply on Jan 14, 2013 10:41 PM by user1099620

    encoding problem


      My webservice function returns the data as XML from PL/SQL package/function.
      The database encoding is CL8MSWIN1251 .

      The PL/SQL function webservice code is:

      <pre class="jive-pre">
      R Xmltype;
      XMLAttributes(id_num as "id_num")
      , XMLForest(
      Name as "Name"
      , Surname as "Surname"
      , field1 as "field1"
      , date2 as "date2"
      , mode3 as "mode3"
      into R
      where id_num = '123456789';

      RETURN R;

      Using webservice thru browser returns:

      <pre class="jive-pre">

      <?xml version="1.0" encoding="UTF-8" ?>
      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ns1:member3Response xmlns:ns1="http://MZFZO121JAVA/MZFZO121.wsdl" SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
      <Member id_num="123456789">

      The question marks are result from different encoding:
      UTF-8 (entire XML) and database query results from CL8MSWIN1251 encoding.

      Any help how to pass Name and Surname from database with encoding CL8MSWIN1251
      into SOAP message with encoding UTF-8.

      The webservice was created with Jdeveloper and deployed on OC4J .

        • 1. Re: encoding problem
          try to use convert function like
          select convert('Привет', 'UTF8') from dual
          for your case
          , XMLForest(
                             convert(Name, 'UTF8')      as "Name"            
                           , convert(Surname, 'UTF8')   as "Surname"
                           , field1    as "field1"
                           , date2     as "date2"                
                           , mode3     as "mode3"           
          also you can add convert to field1 and ...
          • 2. Re: encoding problem
            I have to correct my statement
            "The webservice was created with Jdeveloper and deployed on OC4J"

            The web service based on the same procedure/function
            I have built, deployed and tested with Jdev/OC4J version 9.0.4
            and in another variant with Jdev/OC4J version

            The encoding problem exist in 9.0.4 operating environment, and
            cann't be fixed with usage od CONVERT function.

            The environment works perfect regarding the encoding.

            Edited by: user1099620 on 14.1.2013 14:41