Hi,
Is there any functionality in the http request library for doing async calls. The library seems quite slow anyway but you would want your process sitting round waiting for a response when it could be doing other stuff.
Thanks
Chris paulson
Thanks for the response.
I'm using 11.6 so I guess I have the latest version without the bug.
Could the client socket use the read-response callback to implement async functionality?
Chris
Hello,
Yes, technically, you should be able to use sockets and use a read-response callback to implement asnyc functionality.
However, since sockets is a low level functionality, you would need to implement the HTTP protocol and it would take some work to do HTTPS and authentication.
Also, you need to consider and test what happens when the callback is called and the user is entering data or interacting with a widget. It might be possible that the UI is not prepared for this behavior.
Here is an old example from the the Knowledge Base:
knowledgebase.progress.com/.../20011
You can also find this example at src/samples/sockets/HTTP/ if you have installed the samples for OpenEdge.
This is a simple example that shows an implementation of HTTP which can give you an idea on how to get started implementing this.
With this program, I was able to type in the text editor while the request was executing in the background.
You can try the following URLs to access data return as REST (using dynamic WebSpeed service in OpenEdge 11.6):
oemobiledemo.progress.com/.../State
oemobiledemo.progress.com/.../Order
When working with sockets, you need to check what type of WAIT-FOR you want to use, the example, uses WAIT-FOR GO OF CURRENT-WINDOW, but in other cases, you may want to use WAIT-FOR READ-RESPONSE OF hSocket or even WAIT-FOR CLOSE OF THIS-PROCEDURE. Working with one active WAIT-FOR is simpler.
There might be more advanced examples around.
I hope this helps.
I found it very easy to use curl for http requests. This doesn't do an async call back the way you might want, but the call to curl can be put in background and then you can periodically monitor for a response file. At least your OE process can do other things instead of blocking on the http request.
Thanks,
I've found a possible way around this. The people I'm interfacing with can do a http post of the data to me. This enables be to capture the data with a webspeed program and get a json object.
For reference I'm speaking to http://www.fastfieldforms.com/ as an easy way of collecting data on mobiles that supports offline.