[progress Communities] [progress Openedge Abl] Forum Post: Re: How To Cancel Request From...

Status
Not open for further replies.
J

jts-law

Guest
Thanks Peter. Regarding using Cancel, Error, or some other method, I'm definitely open to suggestions. Since I'm handling the connections to the proper domain in this Invoking handler, I think this is where I want to be able to stop processing if the user doesn't have access to the requested URI. Since posting this question I have been playing around with it trying to get a response returned and this is what I have come up with. I'm thinking the json will need to be tweaked as I'm not exactly sure what KUIB will be expecting. Based on your comments, I could remove the Cancel property and just go with the Error. Thoughts/suggestions? jsonArry = NEW JsonArray(). jsonData = NEW JsonObject(). jsonData2 = NEW JsonObject(). jsonData:Add("_retVal", ""). jsonData2:Add("message", "Unauthorized access"). jsonArry:Add(jsonData2). jsonData:Add("_errors", jsonArry). jsonData:Write(lcResp, TRUE). poEventArgs:Cancel = TRUE. poEventArgs:Response:StatusCode = 400. poEventArgs:Response:StatusReason = "Unauthorized access". poEventArgs:Response:ContentType = "application/json". poEventArgs:Response:ContentLength = LENGTH(lcResp). oWriter = NEW WebResponseWriter(poEventArgs:Response). oWriter:Open(). oWriter:Write(lcResp). oWriter:Close(). poEventArgs:Error = NEW AppError(cStat + " " + cContactMsg, 400). RETURN. The result is: { "_retVal": "", "_errors": [ { "message": "Unauthorized access" } ] }

Continue reading...
 
Status
Not open for further replies.
Top