Loading ...
Sorry, an error occurred while loading the content.

How do you deal with the different kind of SOAP clients and encodings on server side?

Expand Messages
  • cedric.boufflers
    Hello, I have already some posts related to this on this group, but I need some enlightenment. In the soap lite cookbook it is specified that on server side I
    Message 1 of 1 , Jul 27, 2005
    • 0 Attachment
      Hello,

      I have already some posts related to this on this group, but I need some
      enlightenment.

      In the soap lite cookbook it is specified that on server side I should
      always expect strings to be encoded with UTF-8.

      So after having some troubles with trying to use the "encode" method to
      convert my string in ISO-8859-1, I've hexa dumped the string I received
      in my server.
      It seems that in some case my string is encoded in UTF-8 (the
      accentuated characters above 0x7f are 2(+) bytes wide) and sometimes it
      is in ISO-8859-1 depending on the client. For example with Java client
      it seems I receive the string in ISO-8859-1 (1 byte wide character even
      for character above 0x7f).

      I need to convert the UTF-8 string in ISO-8859-1 because it is the
      default encoding of our database. So I use the perl 'encode' methode,
      but if the string are not UTF-8 like it is the case with the Java
      Client, the 'encode' method crashes. (I use the xsd:string datatype for
      string as defined in SOAP and XML).

      So my question is simple, why sometimes I do not have the string encoded
      in UTF-8 depending on the client? How could I ensure that actually
      everything would be UTF-8 on server side as it is written in the doc (it
      seems it's related to the XML::Parser).

      Or maybe I'm doing things in the wrong way, so how do you deal with
      encoding problems? My problematic is to have a constant encoding on the
      server side to be able to encode the string in ISO-8859-1 before to
      insert them in the database. How would you do that regardless the SOAP
      client used and encoding used on client side?

      I hope this is not to confuse ;-) I have been blocked with this problem
      for some times now, and I really have to solve it quite soon, so any
      help would be much appreciated :-)

      The server is intalled with a PERL 5.8, It should be able to run in both
      cgi-bin mode and with modperl.

      Best Regards,
      Cédric

      --
      ---------------------------------------------------------------------
      BOUFFLERS Cédric : cedric.boufflers@...
      ---------------------------------------------------------------------
    Your message has been successfully submitted and would be delivered to recipients shortly.