Consultor Eletrônico



Kbase P92983: Simple Hello World WebServices 4GL code example using the OpenEdge Sonic-ESB adapter
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   26/11/2008
Status: Verified

GOAL:

Simple Hello World WebServices 4GL code example

FACT(s) (Environment):

OpenEdge Sonic-ESB adapter is used
Windows 2000
OpenEdge 10.0A
SonicMQ 5.0.1

FIX:

/*AppServer 4GL code apps.p:*/

DEFINE INPUT PARAMETER stest AS CHAR .
DEFINE OUTPUT PARAMETER outest AS CHAR.

outest = STRING(TIME,"hh:mm:ss") + " : " + stest + " World".

/*4GL client code:*/

DEFINE VARIABLE hWS_4GLObj AS HANDLE NO-UNDO.
DEFINE VARIABLE hWebService AS HANDLE NO-UNDO.

CREATE SERVER hWebService.
hWebService:CONNECT("-WSDL 'WS_4GL.wsdl'
-Service WS_4GLService
-Port WS_4GLObj").

IF NOT hWebService:CONNECTED() THEN DO:
/* SERVER NOT CONNECTED */

RETURN.
END.

RUN WS_4GLObj SET hWS_4GLObj ON hWebService.

DEFINE VARIABLE stest AS CHARACTER INITIAL "Hello ".
DEFINE VARIABLE outest AS CHARACTER.

/* This is which is calling apps.p within the AppServer */
RUN apps IN hWS_4GLObj(INPUT stest, OUTPUT outest).

MESSAGE outest VIEW-AS ALERT-BOX.


DELETE PROCEDURE hWS_4GLObj.
hWebService:DISCONNECT().
DELETE OBJECT hWebService.

RETURN.