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

Re: AW: SV: SV: Question about http_url_post_raw2()



Hi all
I try to use TRCCNN but , maybe I have not the enough knowlegde , I didn't find any useful information. Maybe the data goes in ASCII but the output was unuseful both I try to end TRCCNN typing *EBCDIC or *ASCII in the CCSID parameter. So can anyone suggest me the way to save the answer that I receive as is in utf-8?
I used these instructions with no results:
fd2 = open('/tmp/logmm.log'
        : O_CREAT + O_TRUNC + O_WRONLY
        : S_IRWXU + S_IRWXG + S_IRWXO);
 dou (not HttpResponse_isAuthenticationError(http_rc));
  // Get document from server and handle http redirects
  // See also: WSDL2R88.HttpResponse_isRedirect()
  dou (not HttpResponse_isRedirect(http_rc));
     http_DebugLog_appendText(
     '** ' + %char(%timestamp()) + ': Sending request to server');

     http_rc =
        http_url_post_raw2(
           url
           : hInpStream
           : %paddr('WSDL2R85_MessageContext_InputStream_read')
           : MessageContext_getSize(hMsgCtx)
           : fd2
           : %paddr('write')
           : getTimeout()
           : getUserAgent()
           : '');

      callp close(fd2);
      leave;
Enddo ;

it seems that when write is done IBM i translate in EBCDIC because the Ifs file CCSID is 280 (italian) Any help would be very useful because I am trying to solve this problem since a month without any important result.
Best regards
Mario


-----Messaggio originale----- From: Thomas Raddatz
Sent: Friday, October 14, 2016 10:44 AM
To: HTTPAPI and FTPAPI Projects
Subject: AW: SV: SV: Question about http_url_post_raw2()

Great stuff. Thanks!

Thomas.


-----Ursprüngliche Nachricht-----
Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Paul Roy
Gesendet: Freitag, 14. Oktober 2016 00:01
An: HTTPAPI and FTPAPI Projects
Betreff: Re: SV: SV: Question about http_url_post_raw2()

xxCMNTRC has been usefull for years but will not work for network at speed
100Mb...
instead of STRCMNTRC...   use TRCCNN  (and optionnaly output to wireshark
as explained  in this article
http://www.itjungle.com/fhg/fhg030514-story02.html)

Paul





From:   "Mario Martoriello" <martoriello@xxxxxxxxxxxxxxx>
To:     "HTTPAPI and FTPAPI Projects" <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Date:   13/10/2016 18:18
Subject:        Re: SV: SV: Question about http_url_post_raw2()
Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx



No not yet, I 'll try it .
Thank you for the link
Bets regards
mario

-----Messaggio originale-----
From: Julius Kaj
Sent: Thursday, October 13, 2016 5:28 PM
To: 'HTTPAPI and FTPAPI Projects'
Subject: SV: SV: Question about http_url_post_raw2()

Have you considered using the built-in communication trace facilities to see what is being sent and received at the TCP layer?

STRCMNTRC
ENDCMNTRC
PRTCMNTRC
DLTCMNTRC

http://www.mcpressonline.com/operating-systems/ibm-i-os400-i5os/problems-communicating.html


http://www.ibmsystemsmag.com/ibmi/administrator/systemsmanagement/Managing-TCP-IP/?page=3




-----Oprindelig meddelelse-----
Fra: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] På vegne af Mario Martoriello
Sendt: 13. oktober 2016 16:30
Til: HTTPAPI and FTPAPI Projects
Emne: Re: SV: Question about http_url_post_raw2()

Yes in the log of SoapUi there is the content type and it is
"Content-Type:
text/xml;charset=UTF-8[\r][\n]"
and I see the german char coded in utf-8 like <ns2:cognNome>SCH[0xc3][0x96]NEGGER where x'c396' is Ö The problem is that when I use SoapUi I am, of course, on my PC and I would like see the same on IBM i to compare the answers and understand if the end-point is the same and react in the same way.
best regards
Mario

-----Messaggio originale-----
From: Julius Kaj
Sent: Thursday, October 13, 2016 1:39 PM
To: HTTPAPI and FTPAPI Projects
Subject: SV: Question about http_url_post_raw2()

Question:
If you look at the data in the Raw tab of SoapUI's response view, does it contain a ContentType http header with charset information? - like for
example:
Content-Type: application/soap+xml; charset=utf-8

I think SoapUI use the charset information to ensure that it interprets what's sent correctly.

HTTP 1.1 says that the default charset is ISO-8859-1 (CCSID = 819)




-----Oprindelig meddelelse-----
Fra: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] På vegne af Mario Martoriello
Sendt: 13. oktober 2016 10:21
Til: HTTPAPI and FTPAPI Projects
Emne: Re: Question about http_url_post_raw2()

Hi Thomas
I can agree with you but my service provider told me, as you know, that he

send data in utf-8 encoding, and I would like see also on IBM i, such data

without any interference to demostrate, if they are in ansi, to my service

provider that is wrong otherwise the answer from my webservice provider is

always the same: I am the only that have such problem because I am on IBM i.
Best regards
Mario


-----Messaggio originale-----
From: Thomas Raddatz
Sent: Wednesday, October 12, 2016 10:57 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Question about http_url_post_raw2()

Hi Mario,

I think that Scott confirmed what I already strongly assumed.
http_url_post_raw2() does not translate the data. Of course Scott is right, that the CCSID of the file is EBCDIC rather than utf-8. But that actually does not matter, since we did not want to do anything with the file on the

IBM i, but FTP (as binary data) it to a PC. So the main key is that you correctly saved the untranslated (raw) data to the file.

At the end I think that we can be sure that you received the special German characters in Ansi and not UTF-8. Therefore I still believe, that the problem is on the server side. Since you apparently received the correct data with soapUI, I have to assume, that soapUI used a different web service endpoint. Remember the slightly different ordering of the
namespaces:

HTTPAPI received:

<soap:Body>
<ns2:VisualizzaErogatoRicevuta
 xmlns:ns3="http://tipodati.xsd.dem.sanita.finanze.it";
 mlns:ns2="http://visualizzaerogatoricevuta.xsd.dem.sanita.finanze.it";
 xmlns="http://visualizzaerogatorichiesta.xsd.dem.sanita.finanze.it";>
 ...

soapUI received:
<soap:Body>
<ns2:VisualizzaErogatoRicevuta
 xmlns="http://visualizzaerogatorichiesta.xsd.dem.sanita.finanze.it";
 mlns:ns2="http://visualizzaerogatoricevuta.xsd.dem.sanita.finanze.it";
 xmlns:ns3="http://tipodati.xsd.dem.sanita.finanze.it";>
 ...

I have never seen a web service that changes the ordering of the namespaces from call to call. On the other hand, there are millions of things I have not yet seen.

It was great if we had a client that we could run unchanged on your PC and

the IBM i. If it produced different results, we could safely assume that it called different endpoints on the server.

Thomas.


Am 12.10.2016 um 10:30 schrieb Mario Martoriello:
Hi Scott
thank you for your answer. I try to explain my problem better. I have
some problem reading a web service response that contains German
characters, see my prevoius post. In this project I use both Httpapi
and WSDL2RPG. When my program read the webservice response that
contains german characters it ends abnormally saying that there was a
wrong encoding character. The web service provider tells that the
encoding was correct. So, according with Thomas Raddatz,  I modified
the program where I read the answer and using the http_url_post_raw2()
I wrote the answer into a ifs file. The code snippet is:
fd2 = open('/tmp/logmm.log'
        : O_CREAT + O_TRUNC + O_WRONLY
        : S_IRWXU + S_IRWXG + S_IRWXO); dou (not
HttpResponse_isAuthenticationError(http_rc));
  // Get document from server and handle http redirects
  // See also: WSDL2R88.HttpResponse_isRedirect()
  dou (not HttpResponse_isRedirect(http_rc));
     http_DebugLog_appendText(
     '** ' + %char(%timestamp()) + ': Sending request to server');

     http_rc =
        http_url_post_raw2(
           url
           : hInpStream
           : %paddr('WSDL2R85_MessageContext_InputStream_read')
           : MessageContext_getSize(hMsgCtx)
           : fd2
           : %paddr('write')
           : getTimeout()
           : getUserAgent()
           : '');

      callp close(fd2);
      leave;
Enddo ;
What I would like to have in the 'tmp/logmm.log' file is the
webservice answer as is alias in utf-8 but when I saw  with  Notepad++
it was in ANSI. Where is my mistake? And what is your opinion about
this error for the german char that I receive from EXPAT?
Best regards
Mario

-----Messaggio originale----- From: Scott Klement
Sent: Wednesday, October 12, 2016 12:21 AM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Question about http_url_post_raw2()

Mario,

You are telling the open() API to create the file in EBCDIC, but you
are telling me that the data is UTF-8.  I don't understand why you are
doing that?

http_url_post_raw2() never translates data.  So if you tell the open()
data that it should use EBCDIC, but the data is UTF-8, the file will
be marked with the wrong CCSID, and that will confuse any program that
relies on the CCSID.

-SK


On 10/11/2016 5:50 AM, Mario Martoriello wrote:
    Hi all
    is possible that http_url_post_raw2()  does some traslantion for
the
    received data? If I use this function and then write the incoming
    data(that should be encoding in utf-8) to a stream file, opened
with
    these instruction
    fd2 = open('/tmp/logmm.log'
             : O_CREAT + O_TRUNC + O_WRONLY
             : S_IRWXU + S_IRWXG + S_IRWXO);
    how are they written in utf-8 or ansi?
    Thanks in advance
    Mario Martoriello



----------------------------------------------------------------------
- This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
----------------------------------------------------------------------
-
----------------------------------------------------------------------
- This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
----------------------------------------------------------------------
-

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com ______________________________________________________________________

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com ______________________________________________________________________
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com ______________________________________________________________________

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com ______________________________________________________________________
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
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
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------