Thursday, May 13, 2010

Consuming BDC Services in a Web Application

In my previous articles, we learnt how to configure SSP, how to associate web applications to SSP, generating BDC application definition using BDC Meta Man and also setting up SSP with the generated BDC Application Definition file. If you have not gone through them yet, you can do so now before we start learning how to consume BDC services. Here are the quick links for reference.

  1. Setting up a Shared Service Provider - Overview
  2. Associating a SSP with a web application
  3. Configuring BDC Application Definitions on SSP
In this article, I will show you how to consume BDC services we prepared above in web applications.

MOSS 2007, provides various out-of-box web parts. All these web parts can be used on pages after SSP is configured with LOB data access. Refer to the following image.



For the sake of demonstration, go ahead and add Business Data List web part on to the page. This web part is used to display list of items from the data source (in this case, Customers table in SQL Server). After the web part is added to the page, we need to let the web part know the source of our data (which is Customers entity from BDC Application Definition file). So, click on "Open the tool pane" to open up the properties window for the web part. In the type, click select icon to see the available BDC types and refer to the following window that you will see with Customers entity we had set up earilier.



Go ahead and select the "Customers" BDC entity and hit "OK". Select default properties and click "OK" again on the web part properties window. The page on which the web part is put will be reloaded and the data will be pulled from SQL Server as show below.



Remember, the above data is read from SQL server and is one-way. BDC does not allow two way communication. Which means, you cannot change data in this list which can sync up the data in SQL Server. That is what exactly is done as an improvement as part of Business Connectivity Services (BCS) in SharePoint 2010.




Technorati Tags: ,,,

No comments:

Post a Comment