Create and Consume WCF in Sharepoint
来源:互联网 发布:最小生成树kruskal算法 编辑:程序博客网 时间:2024/05/16 19:12
In this case, you needn't create a seperate Web site for the WCF services, the services will share the same web and port number with existing sharepoint site. Because it is a farm solution, once it is deployed, it will be shared in the whole farm.
Here are the steps,
1. Create a new Sharepoint Empty project "SPFirstWCF".
2. Add Reference.
a. System.ServiceModel
this one is the core assembly for WCF
b. Microsoft.SharePoint.Client.ServerRuntime
This contain the attribute [BasicHttpBindingServiceMetadataExchangeEndpointAttribute] which allows SharePoint to automatically support metadata exchange endpoints, and is the secret sauce that allows us to develop custom WCF services without having to deploy endpoint configuration to the SharePoint web.config.
This assembly is locating at %Windows%/assembly/GAC_MSIL/Microsoft.SharePoint.Client.ServerRuntime
3. Add a SharePoint Mapped Folder to the ISAPI folder, and create an empty text file with the .SVC extension. Note that it is always a good practice to create a sub-folder when deploying your custom code to the SharePoint file system. It helps keep you custom code separate from the original installed files.
4. Create WCF service Interface
5. Create WCF service class
6. The assembly will go to GAC after the deployment. You can check its public token and version number
7. Based on above information, modify the svc file
8. Deploy the solution to the sharepoint farm. you can use this link to check whether it is working
http://localhost:26292/_vti_bin/GSWCF/gswcf.svc/mex the mata data info should be returned.
9. Create a test console project and add the service reference by using that service URL.
Here is the code,
ALL done!!
- Create and Consume WCF in Sharepoint
- Wcf Publish and consume
- How to create, host, test and consume a WCF Web Service
- Create folder and subfolder in Sharepoint
- Create and Call HttpHandler in SharePoint
- Create Managed Accounts in SharePoint
- SharePoint 2007 - /_layouts and how to create pages that run in site context
- How to create your own custom 404 error page and handle redirect in SharePoint 2007 (MOSS)?
- Create custom Task List and Forms in SharePoint 2010 with Visual Studio 2012
- How to create your own custom 404 error page and handle redirect in SharePoint
- 记录一个:Create, Update, Delete and Copy Item Activity in SharePoint 2010 Workflow
- Create and Install Temporary Certificates in WCF for Message Security During Development
- Web.Config - create WCF REST Service and host in Windows Azure
- Create a dialog in Sharepoint 2010
- How to Create Mysite in SharePoint 2010
- How to consume your time in your developing and how to use a efficient way?
- consume
- How to create a Gantt chart in SharePoint
- C#中父窗口和子窗口之间实现控件互操作
- Linux挑战基因网络——电脑操作系统与生物基因网络之对比
- InstallShield内部库函数全集(中文版)
- SSH连接的时候Host key verification failed.
- 每天学一点flex(2):Accordion 组件
- Create and Consume WCF in Sharepoint
- print message to debug output window (VS)
- java使用通配符简化泛型使用
- Terracotta 3.2.1简介 (一)
- (转)自定义Android组件之带图像的TextView
- 嵌入式内功.葵花宝典
- Nutch 1.0在windows下的免cygwin运行--目前无解
- IIS安装
- IT人的学习方法论(全)