Web Service Data Source¶
This data source executes a web service call and returns the result as a list of values.
The web service must adhere to the SOAP standard. If the service is in a RESTful format, the ScriptDataSource should be used to call the service.
The Input
property is used to define the request body of the web service call. It must be in XML format but supports data templates expressions to dynamically incorporate values from the data model.
The ItemXPath
property is used to define the XPath expression to extract the items from the response XML.
Example¶
1 2 3 4 5 6 7 8 |
|
In this configuration:
Service
is set toMyService
, specifying the name of the web service to call.Contract
is set toMyContract
, specifying the contract or interface of the service.Operation
is set toMyMethod
, specifying the method to call within the service.TextFormat
is set to{{s:Name}}
, indicating that thes:Name
element within each item from the service response will be used for the display text.ValueFormat
is set to{{s:Value}}
, specifying that thes:Value
element within each item will be used as the underlying value.Mappings
is empty, meaning no additional mappings are specified.ItemXPath
is set to<![CDATA[s:Rows/s:Row]]>
, specifying the XPath expression to extract individual items from the response XML. It is looking fors:Row
elements under thes:Rows
element.Columns
is empty, meaning no specific columns are being retrieved other than what is defined in theItemXPath
andTextFormat
,ValueFormat
.Input
defines the XML request body. It uses the{{search}}
data template expression to include a value from the data model into the request, within thes:Argument
element of thes:Body
.
In summary, this data source will call the MyMethod
operation of the MyService
service, using the MyContract
contract. It will send an XML request containing an argument based on the search
property in the data model. The response will be parsed, and the s:Name
and s:Value
elements from each s:Row
element under s:Rows
will be used to populate the list of values.