Focal Point
[CLOSED] WebFOCUS Errors / Server 500 Handling

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6227032686

April 25, 2017, 09:34 AM
tkuhns
[CLOSED] WebFOCUS Errors / Server 500 Handling
All,

I am working on a project where I need to intercept the http response code and determine if the procedure ran successfully or if there was an error. Is there a setting in WebFOCUS where this behavior can be set. I am getting a response of 200 (status ok) when calling a report where there is a missing amper variable for instance. I would prefer for this to be responded to with a status code of 5XX.

I am programmatically calling the WFServlet url with parameters a specific report needs. I don't want report failures to be sent as successes. The only way that I can think to dynamically determine success/fail is to screen scrape the response message and search for 'ERROR' or 'FOC####' or similar. This isn't a clean way to handle errors.

Can someone please offer any other solutions that they are using to determine success or fail of a WFServlet call via code? There must be some way of determining failure as Report Caster has the 'On Error' option when reports fail.

This message has been edited. Last edited by: FP Mod Chuck,


WF 8.2, Dev Studio, DB2, MySQL, self-service
Output formats: HTML, Excel 2000 and PDF
May 02, 2017, 05:09 PM
dhagen
I wouldn't advise pursuing this. A 200 is a HTTP thing, not a WF thing. I would go with your option of parsing the response, or better yet, use ReST instead of directly consuming the WFServlet. The ReST response will identify a successful or failed execution as part of the XML response object. It is predictable and will respond to the same _path expression. It will take the guess work out of it.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
May 03, 2017, 11:55 AM
tkuhns
dhagen,

Thanks for the reply. The Rest call seems like a better way to handle this. I have never used their services this way, but it appears that it will work well.


WF 8.2, Dev Studio, DB2, MySQL, self-service
Output formats: HTML, Excel 2000 and PDF
May 03, 2017, 04:08 PM
FP Mod Chuck
Hi Tkuhns

There is one thing you need to be aware of. Using the REST Web Services is a separately licensed WebFOCUS component called Web Services. It will not work if that is not part of your WebFOCUS license key. You can check to see if this is licenced from the WebFOCUS Administation Console for 8.2 there is a menu option labeled Licenses / WebFOCUS client


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats