Hi, Maybe a stupid question, but is it possible to let a webspeed-broker connect to an AppServer when it starts in the OpenEdge Explorer. At some point I need the Handle to the AppServer for 'run "abcd" on server handle-appserver' in my webspeed programs. Or is the only way a CONNECT statement in the webspeed programs everytime I need some data and businesslogic ? Kind regards Bart Syryn
These kind of things typically require you to take your own copy of the web-disp.p which is the WebSpeed agent startup procedure. Sometimes it may be enough to use your own startup procedure, do your custom initialization, connect to your appservers and run web-disp.p as the final statement.
FWIW, there was a bunch of functionality jammed into WebSpeed in 9.1D. Part of this was the ability to set a SUPER_PROC env var for the agent which identified the name of a super-procedure to be run at startup. It was added to a potentially long list of other procedures in the super stack. If Mike's answer doesn't meet your need, you could try this. Caveats: I have never used it so I can't comment on its usefulness, and I don't know if this is supported in PASOE WebSpeed.
Hi,
First of all, thanks for the replies !
The two solutions seems to accomplish what I was looking for.
I've added a super-procedure in the webspeed broker (Environment). In that procedure I connect to the AppServer (like Peter suggested).
I came accross two issues. First was the use of the function 'getAppServer'. I couldn't implement this in my procedure that runs on the webserver (abc.p) and need to run a procedure on the appserver (def.p). I wasn't able to get the handle of the appserver because I wasn't able to call that function. I'm missing something here... So I solved it with a global shared variable, maybe not the best solution but it worked.
Second issue, how can I disconnect from the AppServer ? The disconnect should happen when the WebSpeed Broker is stopped...
Kind regards
Bart S.
Do you really need to disconnect? When the client (WebSpeed agent) QUIT's the AppServer connection will be disconnected anyway. And that will also call the disconnect procedure - if that's your concern.
In web-disp.p there is a WAIT-FOR Block.
/* Wait for a web-request to come in */ WAIT-FOR-BLOCK: REPEAT ON ERROR UNDO WAIT-FOR-BLOCK, LEAVE WAIT-FOR-BLOCK ON QUIT UNDO WAIT-FOR-BLOCK, LEAVE WAIT-FOR-BLOCK ON STOP UNDO WAIT-FOR-BLOCK, NEXT WAIT-FOR-BLOCK:
My expectation is, that when WebSpeed exists, the code after that block would be executed. So you'd be back at maintaining your own web-disp.p. At least for a test.
Hi Mike,
If the connection is disconnected in a correct manner when the WebSpeed broker is stopped, than there's no need to add it in a .p.
I'll do some testing and see what happens.
Thanks !