Remote Host Refused Connection
Posted: Fri Jul 25, 2025 9:40 am
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********************
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********************