ASYNCHRONOUS Web Service Call

Elod

New Member
Hi all,

I'm trying to call a ws asynchronously, unfortunately it does not trigger.

Here is the snippet:

Code:
    CREATE SERVER hWebService.    
    /* connect to webservice */
    lStatus = hWebService:CONNECT("-WSDL '" + evcli.urn + "'") NO-ERROR.
    
    /* web service connected, send message */
    IF lStatus THEN
    DO: /* <portType name="consumerObj"> */    
        RUN VALUE(evcli.portType) SET hconsumerObj ON hWebService NO-ERROR.
        /* reset error-status */            
        ERROR-STATUS:ERROR = NO.

        ASSIGN iRetryCount = 0.
        REPEAT:
            /* run procedure and send the XML message */
            RUN VALUE(evcli.operation) IN hconsumerObj ASYNCHRONOUS (INPUT  ipcTableName) NO-ERROR.
            
            IF  ERROR-STATUS:ERROR THEN
                iRetryCount = iRetryCount + 1.
            ELSE
                LEAVE.
            IF  iRetryCount > 2 THEN
                LEAVE.
        END.
        IF  iRetryCount > 2 THEN DO:
            {debug.i "ERROR-STATUS:GET-MESSAGE(1)"}
        END.
        
        hWebService:DISCONNECT(). /* session ended */
        DELETE OBJECT hconsumerObj NO-ERROR.
    END.
    ELSE DO:
        {debug.i "'Web service not available!'"}
    END.
    
    DELETE OBJECT hWebService  NO-ERROR.

If I do a standard request, it eats some time so I decided to make an ASYNCHRONOUS call which is much faster, and also I'm not interested to wait for a response from the other system.
Standard call works, but if i'm doing it asynchronously it does not trigger the other system.
Do I have a wrong syntax, did anyone worked with asynchronous ws, as calls?

Thanks in advance.
 
You are using sync method to call anync procedure.

Most of times you have to specify callback procedure.
+ Make sure call back procedure is still alive (current module didnt finish).

Here is example:

/* creating callback module */
RUN callbackmodule.p PERSISTENT SET hCallbackModule.

RUN VALUE(evcli.operation) IN hconsumerObj ASYNCHRONOUS (INPUT ipcTableName) EVENT-PROCEDURE "OnEnd" IN hCallbackModule NO-ERROR.

callbackmodule:

PROCEDURE OnEnd:
define input parameter resultstring as character /* like output parameters of VALUE(evcli.operation) */

message "webservice returned value" + resultstring.
end.
 

Elod

New Member
Thanks for the answer.

Turns out that it is not mandatory to use an EVENT-PROCEDURE. You can simply call a web service asynchronously to save some time.
Problem was with prowin32.exe for Progress 10.1C, it seems that it does not work correctly under Windows.

Same code ran under HP-Unix works exactly as expected.
 
Top