LIBHTTP release 1.23
Looking for some help with this error message: "SetError() #2: Host name look up failed'
The DNS answer a ping and returns the correct IP.
The trace is not showing any activity going to the destination.
I am using
http_url_post_raw. I cloned EXAMPLE05 and tweaked the PARMS to it look like this:
H DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR('HTTPAPI')
D/copy qrpglesrc,httpapi_h
D incoming PR 10I 0
D descriptor 10I 0 value
D data 8192A options(*varsize)
D datalen 10I 0 value
*
D rc s 10I 0
D msg s 52A
D CRLF C CONST(x'0d25')
D data S 1024A
D retdata S 32766A
D retlen S 10I 0
D nextpos S 10I 0 inz(1)
*
C *ENTRY PLIST
C PARM PR_Return_Code 7
C PARM PR_Error_Msg 52
C PARM PR_Destination 512
C PARM PR_Content_Typ 256
C PARM PR_Send 32766
C PARM PR_Return 32766
/free
*inlr = '1';
http_debug(*ON);
data = "" + CRLF;
rc=http_url_post_raw(%trim(PR_Destination) +
%trim(PR_Content_Typ) :
%addr(data) :
%len(%trimr(data)) :
1 :
%paddr('INCOMING')) ;
if rc <> 1;
msg = http_error;
dsply msg;
return;
// convert the data we just received to EBCDIC
if retlen > 1;
callp http_xlate(retlen:
retdata:
TO_EBCDIC);
PR_Return=%trimr(retdata);
endif;
// now the returned data is in the 'retdata' string.
// run this program in debug and display retdata.... you'll see...
return;
/end-free
P*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ P* this procedure will receive the raw data received P*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ P incoming B D incoming PI 10I 0 D descriptor 10I 0 value D data 8192A options(*varsize) D datalen 10I 0 value C* Make sure we don't overflow the string: c eval retlen = (nextpos + datalen) - 1 c if retlen > %size(retdata) c eval datalen=datalen-(retlen-%size(retdata)) c endif C* If there is nothing to write, return THAT... c if datalen < 1 c return 0 c endif C* Here we add any data sent to the end of our 'retdata' string: c eval %subst(retdata: nextpos) = c %subst(data:1:datalen) c eval nextpos = nextpos + datalen c* We always return the amount of data that we wrote. Note C* that if http-api sees that we didn't write as much data as C* it sent us, it'll abort the process with an error message. c return datalen P E ****************** End of data *******************************************************
DAVID HANNEMAN | Sr. AS/400 (Synon) Developer | Distribution Services | 4101 Winfield Road, Warrenville, IL 60555-3521 | o 630.322.6420 c 815.474.3674
| e dave.c.hanneman@xxxxxxx w www.rrd.com
|
|
|
|