Hi there everyone. Giel here.
I am using HTTPAPI version 1.45
I am attempting to connect to the following API
https://zedatest.apigw-aw-eu.webmethods ... Id=8542710
Using http_string and getting the following error:
connect(2): A remote host refused an attempted connect operation.
I am able to connect to this api using post PostMan and Java but not via the AS400.
This is what my code looks like:
**free
//Debug
http_debug(*on: inFileName);
clear outMessage;
if inEnv='' or inApiKey='' or inFileName='' or inProfileId=''
or inEntryId='';
outMessage = 'ERROR - Some Crutial Data is Missing';
else;
url = %trim(inEnv) +
'gateway/ALCDocument/1.0/getDocument?LaserficheProfileId=' +
%trim(inProfileId) +
'&EntryId=' +
%trim(inEntryId);
http_setAuth( HTTP_AUTH_NONE: '': '');
monitor;
req = http_string('GET': url);
on-error;
outMessage = http_error();
endmon;
endif;
This what the debug file looks like:
************Beginning of data**************
HTTPAPI Ver 1.45 released 2021-09-20
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R5M0
http_setauth(): entered
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry : 2
DNS resolver options: x'00000136'
DNS default domain: ZEDA.CO.ZA
DNS server found: 10.98.250.230
DNS server found: 10.98.250.231
Nagle's algorithm (TCP_NODELAY) disabled.
SetError() #6: connect(2): A remote host refused an attempted connect operation.
http_close(): entered
************End of Data********************
Remote Host Refused Connection
-
- Site Admin
- Posts: 905
- Joined: Sun Jul 04, 2021 5:12 am
Re: Remote Host Refused Connection
The host you are attempting to connect to is refusing to let you connect.
If the URL is the same, but the other program is running on a different computer, it probably means its a firewall.
If its a timing problem (works sometimes and not others) it probably means that the server is being taken offline at various times.
- Most of the time, this means there is no application running on that port.
- It can also (rarely) mean that a firewall is blocking the connection and is sending back an ICMP message to let you know. (Most firewalls don't do this because they are subject to DOS attacks, but occasionally you run into one that does.)
- It could also mean that you have the hostname, port, or prototcol wrong in the URL.
If the URL is the same, but the other program is running on a different computer, it probably means its a firewall.
If its a timing problem (works sometimes and not others) it probably means that the server is being taken offline at various times.
Re: Remote Host Refused Connection
thank you for the response. I just want to check, before I contact the network people. Would this still be true even if I am able to ping the server from the AS400? I just want to get my wording correct for the network team
I think also it could be to do with the fact that it is an HTTPS, there might be something I need to do differently on the AS400 setup
I think also it could be to do with the fact that it is an HTTPS, there might be something I need to do differently on the AS400 setup
-
- Site Admin
- Posts: 905
- Joined: Sun Jul 04, 2021 5:12 am
Re: Remote Host Refused Connection
yes, it has nothing to do with ping