[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: No access to Webspeed workshop via PasOE OE11.7

Status
Not open for further replies.
B

brianlafertewk

Guest
Peter, The current implementation makes it easy to get access to cookies, headers and query values/parameters ( poRequest:GetHeader("X-My-Stuff"):VALUE; poRequest:GetPathParameter("ItemID"); poRquest:URI:GetQueryValue("qType"); poRequest:GetPathParameter("GroupName")). These all work well and are easy to understand. Even getting a JSON body is 'fairly' straight forward, but not nearly as simple. There could be a better way, but right now I am creating aa Payload.MessageWriter, using Write(poRequest:Entity) and then casting the Entity as a JSONObject. It would seem that a 'poRequest:GetMessageBodyJSON()' or something similar would make life easier. But once you need access to basics like form field, things get much more complex. Where as in WebSpeed we could simple call 'get-value("uType")' to get form field passed into a request, and even 'get-long-value("b64Image")' to get large items (like base64 image uploads), there is just no easy equivalent using WebHandlers. Right now, as far as I can see, we need to Use the Payload.MessageWriter on the poRequest:Entity, cast that a a MulitpartEntity, get each entity part using Entity:GetPart(x), get the Header of the part, extract the field name from the header, and then the value from the body. I've written logic for this(to return the entire set as an easy to use StringStringMap, but it will probably fail in the case of weird multipart entities and I'll end up having to go an re-write it; and I'm sure my logic won't work for super long values (like encoded images), and I'm not even thinking about binaries. So, by moving away from the Compatiblity hander (which will allow us to access WebSpeed functions), I've now made basic things harder and more fragile. Sure, I can eventually code around it, but that's pulling me away from getting actual work done. We are only just at the start of our migration to PASOE and WebHandlers. A majority of our new work will likely involve parsing JSON bodies from REST calls, but not all. We will need to receive data as a form-body from some partners, and in those cases PASOE/WebHandlers is harder than using the Compatibility handler and writing old-school Webspeed programs.

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