Hi all,
 
I'm having some trouble with character encoding on cocoon. Basically, i'm using Jboss-Net to access webservices via SOAP. The Soap Response has the encoding correct but the presentation (with cocoon) is showing some characters all garbled.
 
Here's a simple method i've used to test this:
 
 
public String teste() {
        return "á : à : ã : â : é : í : ó : õ : ú : Á : À : Ã : É : Í : Ó : Õ : Ô : Ú : ç : Ç";
 
 
These are the special characters i'm having trouble with. The SOAP encoding is UTF-8, according to the Jboss-Net log.
 
I've set up a small match on the sitemap to serialize the response to HTML:
 
<map:match pattern="soap.html">
        <map:generate type="serverpages" src=""/>
        <map:serialize type="html"/>
      </map:match>
 
 
teste.xsp has the SOAP call:
 
<?xml version="1.0" encoding="utf-8"?>
<xsp:page
  language="java"
  xmlns:xsp="http://apache.org/xsp"
  xmlns:xsp-request="http://apache.org/xsp/request/2.0"
  xmlns:xscript="http://apache.org/xsp/xscript/1.0"
  xmlns:soap="http://apache.org/xsp/soap/3.0"
  xmlns:xsp-session="http://apache.org/xsp/session/2.0"
  >
 
  <page>
      <soap:call url=""http://192.168.0.2:8080/jboss-net/services/Teste">http://192.168.0.2:8080/jboss-net/services/Teste">
        <ns1:teste xmlns:ns1="urn:Teste">
        </ns1:teste>
      </soap:call>      
  </page>
</xsp:page>
 
 
The output on the browser is showing these strange characters:
á : à : ã : â : é : í : ó : õ : ú : Á : À : Ã : É : Í : Ó : Õ : Ô : Ú : ç : Ç 
 
 
and the Source shows:
<page xmlns:xsp="http://apache.org/xsp" xmlns:xsp-session="http://apache.org/xsp/session/2.0" xmlns:xscript="http://apache.org/xsp/xscript/1.0" xmlns:soap="http://apache.org/xsp/soap/3.0" xmlns:xsp-request="http://apache.org/xsp/request/2.0">
        
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"         xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ns1:testeResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:Teste">
  
<testeReturn xsi:type="xsd:string">&Atilde;&iexcl; : &Atilde;&nbsp; : &Atilde;&pound; : &Atilde;&cent; : &Atilde;&copy; : &Atilde;&shy; : &Atilde;&sup3; : &Atilde;&micro; : &Atilde;&ordm; : &Atilde;&#129; : &Atilde;&#128; : &Atilde;&#131; : &Atilde;&#137; : &Atilde;&#141; : &Atilde;&#147; : &Atilde;&#149; : &Atilde;&#148; : &Atilde;&#154; : &Atilde;&sect; : &Atilde;&#135;</testeReturn>
  </ns1:testeResponse>
 </soapenv:Body>
</soapenv:Envelope>      
 
</page>
 
 
I'm not sure why this is happening, but i guess it has something to do with character encoding that cocoon is applying to the SOAP response. I've tested the webservice with a small VB.Net console application, and the output is correct, so the problem is definitely with cocoon.
 
Any thoughts on this?
 
Thanks in advance.
--
Nuno Leong
Práxia SI

Reply via email to