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:
Serviceis set toMyService, specifying the name of the web service to call.Contractis set toMyContract, specifying the contract or interface of the service.Operationis set toMyMethod, specifying the method to call within the service.TextFormatis set to{{s:Name}}, indicating that thes:Nameelement within each item from the service response will be used for the display text.ValueFormatis set to{{s:Value}}, specifying that thes:Valueelement within each item will be used as the underlying value.Mappingsis empty, meaning no additional mappings are specified.ItemXPathis set to<![CDATA[s:Rows/s:Row]]>, specifying the XPath expression to extract individual items from the response XML. It is looking fors:Rowelements under thes:Rowselement.Columnsis empty, meaning no specific columns are being retrieved other than what is defined in theItemXPathandTextFormat,ValueFormat.Inputdefines the XML request body. It uses the{{search}}data template expression to include a value from the data model into the request, within thes:Argumentelement 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.