Example: silverlight_service_callWeb Services Functions (SOAP, WEB_SERVICE, Silverlight)

Calls a web service in a Silverlight environment.

int silverlight_service_call( const char *StepName, [URL,] ExpectedResponse, <List of specifications>, [BEGIN_ARGUMENTS, Arguments, END_ARGUMENTS,] [Send Attachments, ][BEGIN_RESULT, Results, END_RESULT,] [Receive Attachments, ] LAST );

StepName The name of the step, as it appears in the test tree. Any text can be used.
ExpectedResponse The type of response to accept. See below ExpectedResponse.
URL The URL (Uniform Resource Locator) of the web service to load.
List of specifications A comma separated list of the format "Specification=value". For a list, see below Specifications.
BEGIN_ARGUMENTS A marker that indicates the beginning of the ARGUMENTS section.
ArgumentsArgumentName=Value. Either the argument name as specified in the WSDL and its assigned value, or one of the User Handler Arguments listed below.
END_ARGUMENTS A marker that indicates the end of the ARGUMENTS section.
Send Attachments The attachments to send. For details, see Attachment Specifications.
BEGIN_RESULT A marker that indicates the beginning of the RESULT section.
ResultsResultName=ParamName. The name of result argument or return value as specified in the WSDL, and the name of parameter in which to store the result.
END_RESULT A marker that indicates the end of the RESULT section.
Receive Attachments The expected attachments to save when received. For details, see Attachment Specifications.
LAST A marker that indicates the end of the arguments list.

silverlight_service_call calls a web service in a Silverlight environment.

This function is generated when you record a SOAP session over HTTP in a Silverlight environment and the WSDL is being used by the script.

This is a high-level function that lets you modify all the SOAP arguments intuitively. Because editing the arguments is likely to be error-prone, it is recommended that the function be modified in the tree view rather than in the script editor.

By default, the URL end-point is taken from the WSDL file. Use the URL argument to overwrite (or parameterize) the web service end-point.

Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure. Note that in many cases, this return value indicates the technical success of the function, and not the result. For example, a function that registers a string to be found in a subsequent step returns LR_PASS to indicate that the registration was successful. This does not indicate that the string was found in the server response.


The URL argument can be parameterized. Most of the values of the specifications can be parameterized. Exceptions are noted in the descriptions.