Share this page

# Example: web_service_wait_for_event

This example shows two asynchronous service requests, specifying events `first_event` and `second_event`, and a call to web_service_wait_for_event that captures the events.

    web_service_call( "StepName=EchoString_101",
        "SOAPMethod=
    ExtendedECHO_rpc_encoded|ExtendedECHO_rpc_encodedSoap|EchoString",
        "ResponseParam=response",
        "Service=ExtendedECHO_rpc_encoded",
        "AsyncEvent=first_event",
        BEGIN_ARGUMENTS,
        "sec=7",
        "strString=jabberwocky",
        END_ARGUMENTS,
        BEGIN_RESULT,
        "EchoStringResult=first_call",
        END_RESULT,
        LAST );
    web_service_call( "StepName=EchoString_102",
        "SOAPMethod=
    ExtendedECHO_rpc_encoded|ExtendedECHO_rpc_encodedSoap|EchoString",
        "ResponseParam=response",
        "Service=ExtendedECHO_rpc_encoded",
        "AsyncEvent=second_event",
        BEGIN_ARGUMENTS,
        "sec=2",
        "strString=borogoves",
        END_ARGUMENTS,
        BEGIN_RESULT,
        "EchoStringResult=second_call",
        END_RESULT,
        LAST );

    lr_output_message("got event %s",
        web_service_wait_for_event("StepName=WaitHere",
            "Quantifier=ALL",
            "Timeout=10000",
            BEGIN_EVENTS,
            "first_event",
            "second_event",
            END_EVENTS,
            LAST)
        );

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: