416.467.9100 | Dundas Data Visualization | Login
Welcome Guest
This is the support page for the legacy Dundas Dashboard application. For assistance with the current Dundas BI application please click here.

This site makes extensive use of JavaScript.

Please enable JavaScript in your web browser and reload the page before proceeding.

Reading From a Web Service

Hide navigation
RSS
Modified on Wed, 04 Aug 2010 02:49 PM Categorized as Add-ons, Data Connectors, How-to, Samples, Tutorials

Overview

Although &dw; supports many popular relational databases such as Microsoft SQL, MySQL, ODBC, etc. there are times when you need to consume data from a source that is very specific to your organization.

This article will be a guide on how to create a very simple data provider plug-in that can be used to retrieve data from a simple data source, in particular, a WCF web service.

Aside from the main plug-in itself, this article will also show how to create a client-side plug-in that will provide a custom user-interface to allow you pass additional parameters to the main plug-in.

Also included in this project is a WCF web-service application that will be called by the data provider to return data.

Note: When creating a Simple Data Provider, the data returned by the provider will not be realtime. That is, it will be cached into the Sync database and subsequent calls to the provider will fetch data from the Sync database. In order to keep data fresh, the data provider will need to have caching enabled.

Minimum Requirements


Getting Started

To create a simple data provider plug-in with a custom user interface, two types of project need to be created: a standard .NET class library project for the server-side plug-in and a Silverlight class library project for the client-side plug-in.

The server-side plug-in will be called by &dw; to fetch the meta-data (schema) and the actual data itself. This is the the core plug-in and is required.

The client-side plug-in will be part of the &dw; user-interface and will provide the user with parameters they can pass to the server-side plug-in. This is an optional plug-in.

Server-side add-on

This plug-in is responsible for fetching the data which then gets returned back to &dw;. It is a .NET Windows Class Library created using .NET 3.5 target version.

In order to create this provider plug-in, a class in the project needs to inherit from a list of available data provider classes: SimpleDataProvider, RelationalDataProvider or OlapDataProvider.

This plug-in will reference the Dundas.Dashboard.Extensibility.Server assembly that is found in C:\Program Files\Dundas Data Visualization Inc\&dw;\2.0.2\SDK\lib\Server.

After this plug-in is compiled, packaged, and properly installed, it will be accessed by creating a Data Connector of the type Other Data Sources (CSV, Excel, Sharepoint, etc.)

Refer to the comments in the code for more information on how to write the necessary code.

Data Connector screen

Data Connector screen


Basics of a simple data provider class

The main class implements the SimpleDataProvider class from the Server API library.

Below are the list of overridable methods and properties that can be implemented as part of the class.

Methods


Properties


Generating the Service Proxy Class

To make it easier to get access to the available methods and classes in the web service, the svcutil program can be used to generate the necessary web service classes.

To generate the service class, run this from the command line:

svcutil http://localhost/WCFServiceApp/FinanceDataService.svc /noconfig /language:CS

Client-side add-on

This plug-in is responsible for providing a user interface to the data provider. It is a .NET Silverlight Class Library created using Silverlight 3 and .NET 4.0 target version.

Note: Although the minimum is Silvelight 3, It is recommended you use Silverlight 4 as the target version

After selecting Other Data Sources from the main Data Connector page and clicking Add..., the Define Data Structures will pop up.

And after selecting the Custom Data Provider option from the Data Source Type drop-down field, several fields will be made available. The values in these fields are passed to the server-side plug-in as part of the Connection String.

Refer to the comments in the code for more information on how to write the necessary code.

Define Data Structures screen

Define Data Structures screen


WCF Service Application

The web-service is written as a WCF Service Application and published to a local IIS directory. It is created using .NET 4.0 target version.

Note: Although this particular sample uses .NET 4.0 target version, you can choose to use as low as version 2.0 if necessary.

To publish the webservice, use the Publish option in Visual Studio to publish the project to a local IIS directory:

Publishing the sample WCF Service Application to IIS

Publishing the sample WCF Service Application to IIS


Once published, you will need to make sure the IIS application is running under ASP.NET Version 4.0:

IIS ASP.NET version

IIS ASP.NET version


Finally, the service can be verified by accessing http://localhost/WCFServiceApp/FinanceDataService.svc in a browser and ensuring no errors are displayed.

Project Structures

Below is the general project structure of three projects involved in the sample solution.

For server-side plug-ins, the project must include a reference to the Dundas.Dashboard.Extensibility.Server assembly (commonly found in C:\Program Files\Dundas Data Visualization Inc\&dw;\2.0.2\SDK\lib\Server\).

For client-side plug-ins, the project must include a reference to the Dundas.Dashboard.Client assembly (commonly found in C:\Program Files\Dundas Data Visualization Inc\&dw;\2.0.2\SDK\lib\Client\).

General structure of the projects in the sample solution

General structure of the projects in the sample solution


Packaging and Installing &dw; Plug-ins

The CustomDataProvider project's output (CustomDataProvider.dll) must be packaged as a DataProviderServer plug-in and the CustomDataProviderClient project's output (CustomDataProviderClient.dll) must be packaged as a DataProviderClient plug-in.

To package and install these plug-ins, refer to the References section for information on how to package and install plug-ins.

References


Download

About Dundas | Contact Us Follow us on Twitter! | Privacy Statement | Report Site Issues

Copyright © 2009-2012 Dundas Data Visualization, Inc.