Question Responding To Post Notification

Potish

Member
I have a WebSpeed application that is receiving a POST notification from a vendor that includes an XML document. When the WebSpeed page receives the post the vendor requires a respond back with the word 'OK' as acknowledgement that notification was successfully received. How would I handle such a response in WebSpeed?

Vendor provided a PHP sample with the following code

// Return the value OK to to acknowledge that the notification has been received.
die("OK");
 

GregTomkins

Active Member
Code:
{wrap-cgi.i}
output-content-type ("text/html":U).
{&OUT} "OK".

Disclaimers:

1. I'm not 100% sure that 'OK' by itself would be considered to be content-type 'text/html', but IIRC it would be.
2. wrap-cgi.i is a Progress-supplied include that defines output-content-type and &OUT. I *think* it's called this in the original install, though it's possible that this is an internal name that we use. It's pretty basic and you could just write what it does directly in ABL, but there's no reason that I know of why you'd want to do that.
3. If you forget to set content-type, the browser displays a highly non-intuitive error (IIRC, 'Webspeed Messenger Process Failure' or something like that).
4. We use WebSpeed constantly, but it's mostly buried in libraries that never change. So I think this will work, but, E&OE ;)
 

lee.bourne

Member
Alternatively, use AppBuilder to generate a CGI Wrapper. Definitely don't use speedscript.
Set the content-type to text/plain. It's obvious where to put this if you're using the AppBuilder generated CGI-Wrapper as it auto generates a procedure to send the headers.
{&OUT} "OK".
 

Potish

Member
Thank you for the suggestions. I have implemented change. Vendor does not provide a way to test this specific item so I will not know until code has been deployed .
 
Top