[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: Problem with httpapi and german characters



Hi Alexander,

Mario uses my WSDL2RPG, which uses http_url_post_raw2() to receive the data. The incoming data is immediately feeded to Expat chunk by chunk. For what I know, http_url_post_raw2() does not change any encoding when it receives the data.

On my advice Mario first checked the debug log and then changed http_url_post_raw2() to use write() to immediately write the received data to a stream file. This way he must have appended the raw data as received from the service to the stream file. If that stream file contains the Ansi hex bytes for the German 'Ö', then these bytes must have been send by the server. That is my understanding of how http_url_post_raw2() works. Just to make it sure: Mario did not specify O_TEXTDATA when opening the stream file. So he should have opened it in binary mode.

The very stange thing at this point is, that Mario swears that soapUI receives the right encoding when calling the same web service. That is what I cannot explain. The problem is that you have to be very careful when looking at the results of different programs. For example, if you use Notepad++ to open an Ansi file, Notepad++ converts the data to utf-8 on copy & paste, when you use it to copy the Ansi data to a new utf-8 file (tab in Notepad++)! So I am not absolutely convinced that soapUI received the correct encoding.

I wonder what a pure Java, C# or PHP client would receive from the web service.

Thomas.

-----Ursprüngliche Nachricht-----
Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Alexander Grünwald
Gesendet: Freitag, 7. Oktober 2016 12:38
An: HTTPAPI and FTPAPI Projects
Betreff: AW: Problem with httpapi and german characters

Hello Mario,

I am coming from Austria and I am used to have such characters in any responses. I change the XML file in the IFS to CCSID 1208 (CHGATR) before I open and import it into the XML Parser. This works well on my machine (of course my system is set to German language).

Mit freundlichen Grüßen/Best regards Mag. Alexander Grünwald

Geschäftsführer/Projektmanagement
SOB Datenverarbeitungsges.m.b.H.
Albrechtstraße 60/9
A-3400 Klosterneuburg

Tel. +43/2243/37201
Fax. +43/2243/37201/5
Mail: alexander.gruenwald@xxxxxxxxxxx

-----Ursprüngliche Nachricht-----
Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Mario Martoriello
Gesendet: Freitag, 07. Oktober 2016 12:26
An: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Betreff: Problem with httpapi and german characters

Hi all
I successfully develop a procedure to consume a web service with Httpapi and WSDL2RPG. Sometimes it happens that when in the answer is a character like ä, ü, ö, Ü, Ä, Ö the Expat procedure that reads the XML message goes in error for “(eXpat error): (4) not well-formed (invalid token)”. I contacted the web service provider and they told me that they used the exact utf-8 encoding. Then I modified my program to read  only the answer and write it in a ifs file without any changes . I suppose  that the data has been written in binary mode as they have been received . Then  I transfer the file from Ifs to my pc via Ftp in binary mode and then open it with Notepad++ and I found that the data was in ANSI and not in UTF-8 and the Ö was coded as x’D6’ instead of x’C3 96’ . Does Httpapi do any changes  to the received data or am I missing something?
Thank you for any Help
Best regards
Mario 
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------