Invoke a web service in SQL Server 2005 Reporting Services
To enable SQL Server 2005 Reporting Services reports to query a web service a developer needs to know the web service namespace, method, SOAP Action, parameters, and schema of the response body. The XML data provider can query a web service directly by parsing the XML structure of the SOAP response directly. The XML Data Provider Query Language (as shown in the sample below), empowers a developer to build this query capability. Note that the language is syntactically and behaviourally different to XPATH.
Create an XML type of datasource and add the following to the query designer. Note that this query retrieves the node from the web service response below. To refer to from the report front-end simply use =Fields!data.Value;
|
XML Data Provider Query Language Sample <Query>
Web Service Response Sample <?xml version=“1.0“ encoding=“utf-8“?> <TestDS xmlns=“http://tempuri.org/“> <xs:schema id=“TestDS“ targetNamespace=“http://tempuri.org/TestDS.xsd“ xmlns:mstns=“http://tempuri.org/TestDS.xsd“ xmlns=“http://tempuri.org/TestDS.xsd“ xmlns:xs=“http://www.w3.org/2001/XMLSchema“ xmlns:msdata=“urn:schemas-microsoft-com:xml-msdata“ attributeFormDefault=“qualified“ elementFormDefault=“qualified“> <xs:element name=“TestDS“ msdata:IsDataSet=“true“ msdata:UseCurrentLocale=“true“> <diffgr:diffgram xmlns:msdata=“urn:schemas-microsoft-com:xml-msdata“ xmlns:diffgr=“urn:schemas-microsoft-com:xml-diffgram-v1“>
|