Web Service

Top Previous Topic Next Topic  Print this topic

Data Aggregation Server 2012 can aggregate data from Web services. This can be achieved using the tag <das:web-service-method> that describes a Web service request-response operation. The request is encapsulated in a tag <das:web-service-input> that contains a

<das:element> that describes the structure of the input parameters received by the server. The <das:web-service-output> tag describes the  XMLresponse received from the server. This response is organized as a <das:hierarchical-data-source>.

 

In the example below a free public Web service, http://www.webservicex.net/country.asmx, is used to output all the country names:

 

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<das:job xmlns:das="http://www.ecrion.com/das/1.0" last-id="19">

 

<!--This sample ilustrates working with web services. A free web service is used http://www.webservicex.net/country.asmx that gives information about countries

and their currencies. Below is an example of listing all countries-->

 

 <das:output id="1">

   <das:element id="2" name="root">

     <das:element-sequence id="8" name="GetCountriesResult" data-source="5">

       <das:attribute id="a" name="text()" value="6"/>

     </das:element-sequence>

   </das:element>

 </das:output>

 

 <das:web-service-method id="7" src="http://www.webservicex.net/country.asmx?WSDL" namespace="http://www.webserviceX.NET" method="GetCountries" protocol="soap12">

 

   <das:web-service-input>

     <das:element id="4" name="GetCountries" namespace-uri="http://www.webserviceX.NET"/>

   </das:web-service-input>

 

   <das:web-service-output>

     <das:hierarchical-data-source id="5" name="GetCountriesResult" namespace-uri="http://www.webserviceX.NET">

       <das:field id="6" name="text()"/>

     </das:hierarchical-data-source>

   </das:web-service-output>

 

 </das:web-service-method>

</das:job>

 

 

Note. This sample can be found in the Samples\Job Samples folder.

 

<das:web-service-method> syntax:

 

Attributes:

 

id - unique identifier of this resource in the current processing job.

protocol - communication protocol used to call this method on the specified web service. Valid values are SOAP and SOAP12. HTTP GET/POST will be supported in future versions.

src - Web service url.

namespace - Web service method namespace.

method - method name.

 

 

Children elements:

 

<das:web-service-input> - describes the XML input that the server must receive in order to perform the requested operation. It must contain a <das:element> child.

<das:web-service-output> - describes the XML output received from the server. It must contain a <das:hierarchical-data-source> child.