SetError() Ñ73: CCSID conversion failed

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
jpgvithas
Posts: 14
Joined: Mon Jul 24, 2023 7:01 am

SetError() Ñ73: CCSID conversion failed

Post by jpgvithas »

I am attaching a TXT file where an error is observed during the HTTPAPI execution, in case you can help me or give me instructions on how to solve it.

During the call to a Web service of the SEVEM entity, this error is not always reproduced, and it works correctly, but in others, such as the example of the call that I attached, it does give an error, so nothing is recovered in the call to the web service.

Performing a debug, the stop with error occurs in: HTTP_req(): in the line:
%len(resultstr) = Len;
Since it doesn't reproduce in all cases, I don't know if it's an API problem.

Code: Select all

// Versión Producción
       url = 'https://ws-single-transactions-prod-es.nmvs.eu:8443/' +
             'WS_SINGLE_TRANSACTIONS_V1/SinglePackServiceV50';
       http_setOption('SoapAction': '"' + %Trim(p_Cod) + %Trim(p_Oper) + '"');
       monitor;
         response = http_string( 'POST': URL: SOAP: 'text/xml');
       on-error;
         pgmerror = 'S';
       endmon;                                                                 
In this case, and after the execution, the value of RESPONSE when giving me an error returns blanks.

SOAP = 65000
URL = 100

Thank you
Attachments
jpg_httpapi_log.7z
(4.05 KiB) Downloaded 1123 times
Scott Klement
Site Admin
Posts: 658
Joined: Sun Jul 04, 2021 5:12 am

Re: SetError() Ñ73: CCSID conversion failed

Post by Scott Klement »

Does it still do the same thing in the current version of HTTPAPI? (You appear to be using a version from 2018...)

Looking at the code, I don't see any reason this error should ever occur... if it still occurs in the current version, please tell me how I can reproduce it.
jpgvithas
Posts: 14
Joined: Mon Jul 24, 2023 7:01 am

Re: SetError() Ñ73: CCSID conversion failed

Post by jpgvithas »

Thanks for your answer.
Several considerations:
1.- Currently the use of the HTTPAPI API is not giving any problem, except for these new programs
that call a new URL, from a new version V50 (see image) and that works in some calls but fails in others
the detailed error in the log that I attached to you.
2.- The update to the new version of API HTTPAPI that you mention worries me, since I cannot stop the different applications
that use the API. If I perform the update, it means previously removing the LIBHTTP library that is being used continuously.
In this sense, I am going to see how I could do it to test what you indicate in your answer. I don't know if there are other options
that you can tell me

I think the error occurs on the new url response and only on certain calls.
So I don't think it's an API problem.

For your information I give you the current code that does not present any problem (V40):

Code: Select all

 // Versión Producción                                                                        
       url = 'https://ws-single-transactions-prod-es.nmvs.eu:8443/' +                               
             'WS_SINGLE_TRANSACTIONS_V1/SinglePackServiceV40';                                      
       http_setOption('SoapAction': '"' + %Trim(p_Cod) + %Trim(p_Oper) + '"');                      
       monitor;                                                                                     
         response = http_string( 'POST': URL: SOAP: 'text/xml');                                    
       on-error;                                                                                    
       endmon;
 
The only difference with the first is V40 by V50.

Thanks
Scott Klement
Site Admin
Posts: 658
Joined: Sun Jul 04, 2021 5:12 am

Re: SetError() Ñ73: CCSID conversion failed

Post by Scott Klement »

I do not work for the company that runs this API -- I cannot tell you what difference it makes to switch from a URL with V40 to V50. This is something you'd need to learn from them, not me.

With regards to HTTPAPI -- why not install the new version in a different library, and test with that library? Leave the existing applications in LIBHTTP running as-is until you've determined if it solves the problem, and test out of something else, maybe call it LIBHTTP145 or something? It's not clear to me why it's important to you to replace the existing library, are you out of disk space?
jpgvithas
Posts: 14
Joined: Mon Jul 24, 2023 7:01 am

Re: SetError() Ñ73: CCSID conversion failed

Post by jpgvithas »

Thanks Scott for your prompt response. I am very grateful to you.

I have not explained well. What I wanted to say is that the API I think is working fine.
If I execute both URLs with the same data, in URL V40 I receive a response, but in URL V50 I do not receive a response,
and in this case after performing DEBUG (see log) it continues giving the same error.
I know that you are unaware of SEVEM, and that I should contact that company, and I am going to tell them,
although I don't know what answer they will give me.

With your idea of ​​the new LIBHTTP145 library, I have installed the latest version.
Until today I had never done this, since colleagues who are no longer in the company did it.

I have performed new tests with HTTPAPI version 1.45 and the error continues to appear.
I attach the log for your information.
Since the error in the log is about CCSID, let me tell you that in my program I use the following code:
HTTP_SetCCSIDs(1208 : 0);

I don't know if it will work, but doing DEBUG on the image source, the LEN field is = -1
In the HTTPAPI_H source, in the HTTP_xlatedyn section I have been able to read: it returns the length of the translated data or -1 in case of failure. But I don't know what error it is.
Finally, I am observing in the logs sent, in the last part, that the XML response issued by the
SEVEM entity, but this response is not received by my program, after giving the error. It only comes to me in white.
In the AS400 with DSPJOBLOG I see the error that you see in the attached image.

Thank you very much
Attachments
MCH1210.png
MCH1210.png (16.21 KiB) Viewed 9696 times
HTTPAPI.png
HTTPAPI.png (11.25 KiB) Viewed 9718 times
jpg_httpapi_log.7z
(4.05 KiB) Downloaded 1162 times
jpgvithas
Posts: 14
Joined: Mon Jul 24, 2023 7:01 am

Re: SetError() Ñ73: CCSID conversion failed

Post by jpgvithas »

If you are so kind, could you help me how can I solve this problem?
Thank you so much.
Scott Klement
Site Admin
Posts: 658
Joined: Sun Jul 04, 2021 5:12 am

Re: SetError() Ñ73: CCSID conversion failed

Post by Scott Klement »

HTTP_xlatedyn is returning -1 because there is a character it cannot translate. I can fix HTTPAPI to not crash when this happens, but it won't change the fact that there's a character it cannot translate... you need to determine what that character is and figure out what you want it to do with that character...
jpgvithas
Posts: 14
Joined: Mon Jul 24, 2023 7:01 am

Re: SetError() Ñ73: CCSID conversion failed

Post by jpgvithas »

Thank you very much for your answer.
Reviewing the HTTPAPI log, I don't see any strange characters in these responses that are sent to us. I only see an accent, but I don't think it's the error. What I really want is to show the response as SEVEM responds to me in its Web Service.
I don't know how to manage it.
jpgvithas
Posts: 14
Joined: Mon Jul 24, 2023 7:01 am

Re: SetError() Ñ73: CCSID conversion failed

Post by jpgvithas »

Is there any possibility of receiving the XML even though HTTP_xlatedyn returns -1, and thus being able to display the result as it comes, or another similar possibility that I can contemplate?
Thanks
Scott Klement
Site Admin
Posts: 658
Joined: Sun Jul 04, 2021 5:12 am

Re: SetError() Ñ73: CCSID conversion failed

Post by Scott Klement »

You can receive the raw value instead of letting HTTPAPI translate it... Try using something like http_url_post_raw instead of http_string...
Post Reply