[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error SetError() #66: Got more error log info now
Scott, I re-ran this program using the version prior to some of the
changes you had made to Craig's code ( the field rate for example you
made numeric, etc.)
now we get a more robust error log.
New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819.
ProtLoc=0
http_url_get():
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:
DNSNAME
DNS server found:
192.nnn.n.n
DNS server found:
192.nnn.n.n
DNS server found:
198.n.n.n
DNS server found: 198.n.n.n
http_persist_get(): entered
http_long_ParseURL(): entered
do_get(): entered
GET /usd/feed HTTP/1.1
Host: xurrency.com
User-Agent: http-api/1.23
recvresp(): entered
HTTP/1.0 200 OK
Date: Wed, 6 May 1970 20:19:59 GMT
X-Date: Tue, 08 Jul 2008 15:49:46 GMT
Server: iPrism-httpd/v4 (Unix) ssl_enabled ossl
Expires: 0
Expires: 0
Cache-Control: max-age=0, must-revalidate
Pragma: no-cache
Content-Type: text/html
SetError() #13: HTTP/1.0 200
OK
recvdoc parms: identity
0
header_load_cookies()
entered
recvdoc():
entered
SetError()
#0:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN\" > <HTML>
<HEAD> <META
http_close():
entered
SetError() #66: XML parse failed at line 1, col 54: illegal
character(s) in public id
--- On Mon, 7/7/08, Scott Klement <klemscot@xxxxxxxxxxxx> wrote:
From: Scott Klement <klemscot@xxxxxxxxxxxx>
Subject: Re: Error SetError() #66:
To: "HTTPAPI and FTPAPI Projects" <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Date: Monday, July 7, 2008, 9:22 PM
Hi Adam,
Unfortunately, you haven't provided enough detail for me to help you. I
assume that you are still using Craig Jabobsen's code, correct? If so,
there's one point at which he uses HTTPAPI to download a file by calling
the http_url_get() API. The code looks like this (I've removed the
comments so we can focus on the code):
--
Url = 'http://xurrency.com/usd/feed';
FileName = Http_TempFile() + '.xml';
RetCode = Http_Url_Get(Url : FileName );
If RetCode <> 1;
UnLink(FileName);
EndIf;
If Http_Parse_XML_Stmf( FileName
: HTTP_XML_CALC
: *Null
: %PAddr(Incoming)
: *Null )
< 0;
EndIf;
--
The problem with this code is that it does not do proper error handling.
If an error occurs during http_url_get(), it erases the temp file, but
does not stop the program! It continues to call the HTTP_Parse_XML_Stmf().
The problem with that idea is that http_parse_xml_stmf() will wipe out
the debug file that was created by http_url_get() -- so you don't have
any diagnostics.
So, after http_url_get() fails, it deletes the XML file, then deletes
the debug file, so you're really left with no information about the
problem. This is the code that's teh culprit:
If RetCode <> 1;
UnLink(FileName);
EndIf;
The easiest fix is to change the above code to look like the following:
If RetCode <> 1;
UnLink(FileName);
http_crash();
EndIf;
The http_crash() API will abort the program with an *ESCAPE message when
it fails. You can use the data in that escape message, in addition to
the data in the /tmp/httpapi_debug.txt file to determine what the
problem is.
Try making that change and see if there's more info in the
/tmp/httpapi_debug.txt file...?
Adam West wrote:
> I have these 2 coded:
>
> H Option(*SrcStmt:*NoDebugIO) Debug(*Yes)
>
> // debug (ifs subdir tmp/httpapi_debug.txt if on)
> Http_Debug(*On);
>
>
> I do not know how to find this questionable character.I am not getting
> any other document or line in the IFD tmp file.
>
>
> THe code has this in it but it is not getting generated
>
>
> // create a tempory file in subdirectory tmp in the ifs
> FileName = Http_TempFile() + '.xml';
>
>
>
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mike Krebs
> Sent: Monday, July 07, 2008 4:34 PM
> To: 'HTTPAPI and FTPAPI Projects'
> Subject: RE: Error SetError() #66:
>
>
> What is the character at position 54 of the xml?
>
>
> Did you turn on debug? You should get much more that one entry if you
> turn
>
> on debug.
>
>
>
> ------------------------------------------------------------------------
>
> -----------------------------------------------------------------------
> 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
-----------------------------------------------------------------------