cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: wsproxy encoding and user-agent
Date Mon, 09 Apr 2007 22:32:52 GMT
On 09.04.2007 23:17, bam wrote:

> I am trying to access a web service with the wsproxy generator.
> I get a iso-8859-1 encoded response (and the remote server tell I use a 
> "Jakarta Commons-HttpClient/2.0.2" user-agent) when I use the wsproxy 
> generator and I get a utf-8 encoded response (and the remote server tell 
> I use a "Mozilla/5.0 (Windows... Firefox/2.0.0.3" user-agent) when I 
> try  the web service directly in a browser (with the very same parameters).

Why do you need a specific encoding? Do your request or response got 
parsed wrongly? There is a discouraging comment in the 
WebServiceProxyGenerator [1, line 115 and following]:

/* TODO: Though I avoided the getResponseBodyAsString(), the content
  *       seems not to be parsed correctly. Who cares about the encoding
  *       in the XML declaration?

Due to container default the request probably gets sent as ISO-8859-1. 
Responses are mostly in the same encoding. In theory the XML parser 
should retrieve the correct encoding from the XML. Don't know what 
happens in this case. Did you have a chance to debug it?

> Is the difference of user-agent provoking the difference of encoding ?

No, probably not. But the request encoding normally has influence on the 
response encoding.

> If so, how can I change the user-agent, I tried 'set-header' but it 
> didn't worked :

This only sets the header on the response from Cocoon to your client I bet.

> If not, what should I do to get a utf-8 response using the wsproxy 
> generator?

Can you tell the actual error you want to solve? That might make wild 
guessing a bit less wild ;)

Regards
Joerg

[1] 
http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/generation/WebServiceProxyGenerator.java?annotate=433543

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message