[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How to access returned XML doc on HTTP 500 error.



Hmm interesting question you bring up. In theory, a 500 error means the server encountered an unexpected condition. That is like a plumbing problem and shouldn't really be a user issue. But I can see that maybe you want to empower the user to call the supplier with the problem...

Did you try using your "Incoming" to parse for the error message? I don't think HTTPAPI cares about the error other than to return the error back to you. Sometimes, HTTPAPI does cut short the conversation when bad things happen but it looks from a brief look at the code that your "Incoming" will be called even if you get a 500 response.

Otherwise, you should be able to process the xml document you get back if you save the data. Pseudo code: 

Post(url: etc: myIFSFile)
if rc <> 1;  // I have an error
  Msg = http_error
  If rc = 500; // read the xml for the error
    http_parse_xml_stmf(myIFSFile: HTTP_XML_CALC:*NULL : FindMyError: *NULL);
    // do something with the error data
  endif;
else; // good post, parse xml for data
  http_parse_xml_stmf(myIFSFile: HTTP_XML_CALC: *NULL : FindMyData: *NULL);
endif; 

  

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Wayne Stemple
Sent: Wednesday, October 23, 2013 8:23 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Cc: Jim Money
Subject: How to access returned XML doc on HTTP 500 error.

I am using the HTTPAPI software to send XML to an external server and
process the returned XML. I am looking to see if it is possible to access
the returned XML document that is written to the debug text file when the
server returns an HTTP 500 error.  The only thing that I can access is the
HTTP 500 error text, but the XML contains more detailed information that
could be displayed back to the user.

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------