Skip to content

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
<WebServiceDataSource Service="MyService" Contract="MyContract" Operation="MyMethod" TextFormat="{{s:Name}}" ValueFormat="{{s:Value}}">
    <Mappings/>
    <ItemXPath><![CDATA[s:Rows/s:Row]]></ItemXPath>
    <Columns/>
    <Input><![CDATA[<s:Body>
    <s:Argument>{{search}}</s:Argument>
</s:Body>]]></Input>
</WebServiceDataSource>

In this configuration:

  • Service is set to MyService, specifying the name of the web service to call.
  • Contract is set to MyContract, specifying the contract or interface of the service.
  • Operation is set to MyMethod, specifying the method to call within the service.
  • TextFormat is set to {{s:Name}}, indicating that the s:Name element within each item from the service response will be used for the display text.
  • ValueFormat is set to {{s:Value}}, specifying that the s: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 for s:Row elements under the s:Rows element.
  • Columns is empty, meaning no specific columns are being retrieved other than what is defined in the ItemXPath and TextFormat, 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 the s:Argument element of the s: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.