Share this page

# web_service_wait_for_event

Web Services Functions (SOAP, WEB_SERVICE, Silverlight)

Waits for response to previous asynchronous service request.

This function returns the name of the event captured. If "Quantifier=ALL" is specified and more than one event is captured, any one of the event names is returned. If the call times out, null is returned.

char * web_service_wait_for_event( const char * StepName, const char * Quantifier, const char * Timeout, BEGIN_EVENTS, const char * EventName_1,[... EventName_n,] END_EVENTS, LAST );

StepName | The name of the step as it appears in the test tree. Any text can be used.
Quantifier | Either ALL or ANY. Indicates whether to wait for all the specified events to return or to wait for the first to return.
Timeout | In milliseconds.
BEGIN_EVENTS | A marker that indicates the beginning of the list of events.
EventName | The list of events to wait for.
END_EVENTS | A marker that indicates the end of the list of events.
LAST | A marker that indicates the end of the argument list.

After a call to web_service_wait_for_event, the test run is paused until receipt of one or all of the events specified.

The events must be created in a previous call to web_service_call.

Note that you have to increase the total number of concurrent connections per host and per vuser to use asynchronous requests. For example:

web_set_sockets_option("MAX_CONNECTIONS_PER_HOST","10");
web_set_sockets_option("MAX_TOTAL_CONNECTIONS","10");

## Parameterization

All arguments can be parameterized using standard parameterization.

## Example

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.

Copy code

    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 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: