axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francisco Serrano <francisco.serr...@multicom.co.uk>
Subject Re: [Axis2] Axis2 client generated from WSDL ignoring encoding
Date Wed, 21 Mar 2012 17:00:34 GMT
Hi Josef,

Sorry for not being clear enough. The version I'm using is AXIS2 1.0 
from 04 - May 2006 (http://axis.apache.org/axis2/java/core/download.cgi).

The web service I'm trying to communicate with is from an external 
company, so I've generated the client from their WSDL. About the version 
they're running I'm not sure...

I'm afraid I'm not able to change the AXIS2 version because the system 
in my company is quite old and will require lots of changes. Isn't there 
any option to specify the encoding for the incoming responses? Otherwise 
maybe I could create sort of an Interceptor to deal with the responses 
before they're delivered to the stub.

Best regards,
Francisco.

On 21/03/2012 14:26, Stadelmann Josef wrote:
>
> Hi Francisco
>
> still unclear to me what you actually use.
>
> You say you have an external server? what make and version of web 
> service stack is running the service you like to work with?
>
> What does the wsdl say when requested?
>
> which version of axis(2) are you using?
>
> AXIS2-1.0 or AXIS-1.0 or what?
>
> AXIS   is the old make of a web service stack
>
> AXIS2 is the total new implementation of a web service engine.
>
> each of the two has several versions. So which one are you using.
>
> When I started in 2006 I took the latest greatest version of AXIS2-1.2.
>
> Since then we have arrived at AXIS2-1.6.1 and more to come ...
>
> Both axis versions are implemented in JAVA
>
> But there is also a AXIS2/C version.
>
> Both AXIS2/J and AXIS2/C have their AXIOM Library,
>
> a library which implements the AXIS2 Object Model
>
> which deals with SOAP/XML constructs and BTW,
>
> maybe with the problems you are faced with.
>
> So are you using AXIS or AXIS2?
>
> and what is the exact version of it?
>
> And yes, I would upgrade.
>
> Generating the stub with the tool WSDL2JAVA isn't a big work
>
> AND it can happen that your problems are gone thereafter.
>
> I would try the following. make a small example, client and server and 
> send &#8211 which is the decimal of 2013 hex. Echo this back and see 
> what you get. If you know what codes and code-pages you need you 
> should do so in a iterative way, you generate the string into a string 
> buffer and pass it to the stub to transmit this string I,e. "&#8211" 
> your server shall return it and you take Wireshark or TCP Monitor to 
> see what you get on the wire in both directions. If it leaves correct 
> in one way and returns correct sequence in the response, and finally 
> arrives wrong in your string buffer (for comparision), you know where 
> your problem is. If you take AXIS2/J-1.6.1 and have no problem I would 
> suggest to generate the stub again and use it. If your external 
> service response badly you know where to ask for upgrading the service.
>
> Josef
>
> *Von:*Francisco Serrano [mailto:francisco.serrano@multicom.co.uk]
> *Gesendet:* Dienstag, 20. März 2012 15:25
> *An:* java-user@axis.apache.org
> *Betreff:* Re: AW: [Axis2] Axis2 client generated from WSDL ignoring 
> encoding
>
> Hello Josef,
>
> Thanks a lot for your reply.
>
> The exact version I'm using is 1.0 and I can confirm that the stub is 
> generated by WSDL2JAVA.
>
> The problem is that from my client I'm using the stub to call an 
> external service. The response from this service is using UTF8 to 
> encode the content, I've checked with Wireshark the communications and 
> messages and the response is specifying UTF8 and the problematic 
> character (a dash) is correctly encoded with UTF8. The response 
> specifies "text/xml; charset=utf-8" in the HTTP header and the xml 
> message within it "<?xml version='1.0' encoding='utf-8'?>" and the 
> character in the payload is specified as: e2 80 93 (UTF-8 (hex) 
> representation for EN DASH: 
> http://www.fileformat.info/info/unicode/char/2013/index.htm).
>
> But when the control comes back to my application, the stub is using 
> ISO-8859-15 (which is the charset specified for my JVM) to decode that 
> response so the response is showing incorrect characters for the dash, 
> debugging the code I'm getting: â
>
> According to 
> http://osdir.com/ml/axis-dev-ws.apache.org/2009-08/msg00132.htmllooks 
> like before version 1.6 the encoding wasn't being taken into account 
> in a reliable way...
>
> Wouldn't be any other way to solve this rather than generating the 
> client with a newer version?
>
> Thanks,
> Francisco.
>
>
> On 20/03/2012 09:12, Stadelmann Josef wrote:
>
> Francisco
>
> What is your exact version of AXIS2?
>
> And just to be sure; are you creating a Java Client calling a stub 
> generated by WSDL2JAVA?
>
> Are you using SOAP-XML over HTTP? THEN XML cannot keep all ISO-8859-1 
> characters.
>
> To transfer you need to escape certain characters before inserting it 
> into your ISO-8859-1
>
> XML string, and it might be better to use UTF-8 for that.
>
> We had recently a similar issue which we did not have unless we 
> changed to AXIS2-1.6.1
>
> Guess it has to do with Axiom version delivered with this release of 
> AXIS2.
>
> I strongly suggest to use TCP Monitor to look what you get back by the 
> sender which is
>
> in your case the service-response.
>
> How does the service return payload characters i.e. a "ä ö ü è é or > 
> < & %"
>
> and I think that will get you further.
>
> http://osdir.com/ml/axis-dev-ws.apache.org/2009-08/msg00132.html
>
> let me know if it helps.
>
> Josef
>
> *Von:*Francisco Serrano [mailto:francisco.serrano@multicom.co.uk]
> *Gesendet:* Montag, 19. März 2012 15:47
> *An:* java-user@axis.apache.org <mailto:java-user@axis.apache.org>
> *Betreff:* [Axis2] Axis2 client generated from WSDL ignoring encoding
>
> Any advice on this please?
>
> -------- Original Message --------
>
> *Subject: *
>
> 	
>
> [Axis2] Axis2 client generated from WSDL ignoring encoding
>
> *Date: *
>
> 	
>
> Thu, 23 Feb 2012 17:02:42 +0000
>
> *From: *
>
> 	
>
> Francisco Serrano <francisco.serrano@multicom.co.uk> 
> <mailto:francisco.serrano@multicom.co.uk>
>
> *To: *
>
> 	
>
> java-user@axis.apache.org <mailto:java-user@axis.apache.org>
>
> Hello,
>   
> I have an axis2 client generated from a WSDL, which is working fine but
> I'm having some problems since it's ignoring the charset specified in
> the response it's getting back.
>   
> The response specifies charset=UTF-8 in the Content-Type HTTP header and
> the same in the encoding parameter in the xml message.
>   
> Instead of using UTF-8 to decode the xml content, it's using ISO-8859-1
> which is the one set for the JVM where the client is running. For this
> reason I'm getting some strange characters in the response. I've double
> checked that the characters are encoded correctly using UTF-8.
>   
> It's an old client generated with version 1.0. Does anybody know if
> there's some issue about that version regarding this problem? Are there
> any parameters to specify the charset to use to decode the response?
>   
> Best regards,
> Francisco.
>
> Multicom Products Limited is a company registered in England and Wales 
> (Registered Number 2447353 Wales) with its registered office at 33 
> Victoria Street, Bristol, BS1 6AS.
> This email is confidential to the addressee and may contain privileged 
> information. If you have reason to believe that you are not the 
> intended recipient of this communication, please delete it from your 
> system and contact the sender immediately. You are not permitted to 
> use or copy this email or its attachments nor may you disclose the 
> same to any third party. Unauthorised use or disclosure of this email 
> is prohibited and may be unlawful.
> We reserve the right to intercept and read emails sent or received by 
> our employees. This is to ensure compliance with our internal policies 
> and to protect our business. If you do not wish for your 
> communications to be subjected to such scrutiny, you should not 
> communicate via this email system.
> We endeavour to exclude viruses and other malware from our data but it 
> is the responsibility of the recipient to scan all emails and 
> attachments for viruses before opening them. We accept no liability 
> for any damage caused by any virus transmitted by this email.
> Email may not be completely secure or error free, can be intercepted 
> or corrupted and may arrive late or not at all. Anyone who 
> communicates with us by email accepts these risks.
>
> -- 
> *Francisco Serrano*
> *Java Developer*
> *Email:* franciscos@multicom.co.uk <mailto:franciscos@multicom.co.uk>
> imap://franciscos@mail0.core.mcom:993/fetch%3EUID%3E.INBOX%3E23781?header=quotebody&part=1.2&filename=image001.png
> *Tel:* 0117 908 1250
> *Address:* 33 Victoria St. 2nd Floor, Bristol, BS1 6AS
> *Facebook:* www.facebook.com/multicomproductslimited 
> <http://www.facebook.com/multicomproductslimited>
> *Twitter:* @MulticomFAB <http://twitter.com/#%21/multicomfab>
> *LinkedIn:* www.linkedin.com/company/multicom-products-ltd 
> <http://www.linkedin.com/company/multicom-products-ltd>
>
> *www.multicom.co.uk* <http://www.multicom.co.uk>
>
> Multicom Products Limited is a company registered in England and Wales 
> (Registered Number 2447353 Wales) with its registered office at 33 
> Victoria Street, Bristol, BS1 6AS.
> This email is confidential to the addressee and may contain privileged 
> information. If you have reason to believe that you are not the 
> intended recipient of this communication, please delete it from your 
> system and contact the sender immediately. You are not permitted to 
> use or copy this email or its attachments nor may you disclose the 
> same to any third party. Unauthorised use or disclosure of this email 
> is prohibited and may be unlawful.
> We reserve the right to intercept and read emails sent or received by 
> our employees. This is to ensure compliance with our internal policies 
> and to protect our business. If you do not wish for your 
> communications to be subjected to such scrutiny, you should not 
> communicate via this email system.
> We endeavour to exclude viruses and other malware from our data but it 
> is the responsibility of the recipient to scan all emails and 
> attachments for viruses before opening them. We accept no liability 
> for any damage caused by any virus transmitted by this email.
> Email may not be completely secure or error free, can be intercepted 
> or corrupted and may arrive late or not at all. Anyone who 
> communicates with us by email accepts these risks.
>

-- 
*Francisco Serrano*
*Java Developer*
*Email:* franciscos@multicom.co.uk <mailto:franciscos@multicom.co.uk>

*Tel:* 0117 908 1250
*Address:* 33 Victoria St. 2nd Floor, Bristol, BS1 6AS
*Facebook:* www.facebook.com/multicomproductslimited 
<http://www.facebook.com/multicomproductslimited>
*Twitter:* @MulticomFAB <http://twitter.com/#%21/multicomfab>
*LinkedIn:* www.linkedin.com/company/multicom-products-ltd 
<http://www.linkedin.com/company/multicom-products-ltd>

www.multicom.co.uk <http://www.multicom.co.uk>


-- 
Multicom Products Limited is a company registered in England and Wales (Registered Number
2447353 Wales) with its registered office at 33 Victoria Street, Bristol, BS1 6AS.

This email is confidential to the addressee and may contain privileged information.  If you
have reason to believe that you are not the intended recipient of this communication, please
delete it from your system and contact the sender immediately. You are not permitted to use
or copy this email or its attachments nor may you disclose the same to any third party.  Unauthorised
use or disclosure of this email is prohibited and may be unlawful.

We reserve the right to intercept and read emails sent or received by our employees. This
is to ensure compliance with our internal policies and to protect our business. If you do
not wish for your communications to be subjected to such scrutiny, you should not communicate
via this email system.

We endeavour to exclude viruses and other malware from our data but it is the responsibility
of the recipient to scan all emails and attachments for viruses before opening them. We accept
no liability for any damage caused by any virus transmitted by this email.

Email may not be completely secure or error free, can be intercepted or corrupted and may
arrive late or not at all. Anyone who communicates with us by email accepts these risks.

Mime
View raw message