AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 12.01.2010, 04:44   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
Muhammad Ali Khan: Business Connectivity Services (BCS) Using WCF & SharePoint Designer 2010
Источник: http://malikhan.wordpress.com/2010/0...designer-2010/
==============


In this post, I will consume a simple WCF service in SharePoint 2010 Designer and create an external content type (formerly known as Entities in BCD).

Step 1:Create the WCF Service & Deploy In IIS

My First step is to create the WCF service. There is nothing fancy about the code, I have one simple “Project” Contract with CRUD methods defined (that later I will consume in BCS), these methods are using LINQ to SQL to my test SQL Server Database (ProjectDB). Here is the WCF Contract.



And here is its implementation



You can download the full code (along with the application definition file from here “Download Code, you can import this application definition file from the Central Administration).

Step 2: Create External Content Type In SharePoint Designer 2010 From WCF Service

After deploying the WCF service in IIS, now let’s move to SharePoint 2010 Designer and create the BCS External Content type from this WCF Service. Open any site in SharePoint 2010 Designer ==> Click External Content Types.



Click “External Content Type” in the Ribbon to create a new External Content type. Fill the “Name” and other properties as shown below.



Click the line “Discover external data source and define operations” and in the new screen, click “Add Connection” and select “WCF Service”.



Fill in the properties “Service Metadata URL”, “Service Endpoint URL” and namespace and the click ok. It will download the metadata from the WCF contract and generate the BCS External Content Type for you.

 After click ok, the external content type from WCF will look like this. Now you have to define the operations for this external content type.



Now one by one, you will generate the method for CRUD (Create, Retrieve, Update, and Delete) and Retrieve List. Here is the step by step procedure for the create method. Right click “Create” and select “New Create Operation”, a wizard will open up.







Now Click “Finish”, it will generate the “Create Method” for this external content type. Similarly, generate the method for other operations. Now your “External Content Type” will look like below,



Save the “External Content Type”, by pressing “Save Icon” in the SharePoint 2010 Designer at the top.



Step 3: Configure External Content Type Profile Page in Central Administration

Now go to Central Administration ==> Application Management ==> Service Application ==> Business Data Connectivity and click “Manage” from the top Ribbon. You will see the screen below,



Click “Edit” from the Ribbon and select “Configure” to configure the path for the “Profile Page” and click ok. See the diagram below.



Generate the profile page for the External Content Type “WCFProject” by click on the dropdown ==> “Create/Upgrade Profile Page”.



So Now if you browse to any project with the above URL (e.g. http://win-1r2gn7r1jaq:8000/_bdc/Ali...0-6b8e8c6367e8), you will get a profile page for the project as shown below.



Step 4: Displaying WCF Service Data In SharePoint List

Now we will create an “External List” to consume this data from WCF Service  as shown below.





Select the “External Content Type (WCFProject)” and click “Create” to create the list. It will pull the listings for all the projects from the WCF “ReteriveMultiple” Method as shown below.



Now you can “Create”, “Update”, “View” and “Delete” any “Project” and it will call WCF Method internally to perform the operation. See the example of the delete below.



Here is the “Create” form.



In Brief, With SharePoint 2010, now we can easily create connect our existing WCF Service with the SharePoint and display, edit,create and delete the data inside the portal.

That’s it .




Источник: http://malikhan.wordpress.com/2010/0...designer-2010/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 20:14.