Answered by:
Where I should publish WCF service ?

Question
-
Hello,
I need to create WCF service and I have two approaches
1) create WCF project and publish the service
2) create sharepoint project ,add WCF service and deploy to the ISAPI folder.
I am very confuse which approach I should consider as best practice and why ?
Please let me know the suggestions.
Thanks,
Dipti Chhatrapati
- Edited by Dipti Chhatrapati Tuesday, March 27, 2012 5:42 AM
Tuesday, March 27, 2012 5:41 AM
Answers
-
Create and Deploy a SharePoint WCF service for following things (http://msdn.microsoft.com/en-us/library/ff521581.aspx , http://nikspatel.wordpress.com/2012/02/29/step-by-step-building-custom-wcf-services-hosted-in-sharepoint-part-i/ ) :
- If you want to use the Complete support of SharePoint APIs
- If you want your client to access your service with the same experience as of SharePoint OOB services
- If you extend some custom functionality of your solution which is by default not provided by SharePoint services.
- If you want to use and provide the same authentication/authorization configured in the farm while accessing your service.
- If your service is getting used internally between the SharePoint farms.
- If you want to access the custom service internally for your Solution (client / server kind of architecture)
Go for a separate WCF service
- If this is just some functionality from your solution which you want to expose to outer world.
- You can only use the Client APIs / SharePoint webservice / or your custom code reference inside your WCF service.
- You have to take care of Authentication/autorization
- If can be accessed by some other client, without even knowing the existence of SharePoint in back-end.
Hope this helps to take a decision.
get2pallav
Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.- Marked as answer by Dipti Chhatrapati Tuesday, March 27, 2012 10:01 AM
Tuesday, March 27, 2012 6:30 AM -
Although I feel get2pallav has provided valuable info, I'd like to add my opinion as well. To me it depends on the following questions:
- If you need the service to run in the current SharePoint context, create a SharePoint project as discussed in the link a provide later.
- Otherwise, create a separate WCF service and run it in a separate (non-SharePoint) IIS web site.
- Consider to wrap a .NET 3.5 service in a separate WCF 4 service that uses TPL to speed up things (the back to the future pattern.
Everything is explained at: http://sharepointdragons.com/2011/10/07/parallel-programming-in-sharepoint-2010-the-back-to-the-future-pattern/
In addition, I've found that all answers contained useful info and I've promoted it to the following Wiki page: http://social.technet.microsoft.com/wiki/contents/articles/8665.sharepoint-2010-best-practices-where-to-publish-a-wcf-service.aspx
Kind regards,
Margriet BruggemanLois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com
- Edited by Margriet Bruggeman Tuesday, March 27, 2012 8:53 AM
- Marked as answer by Dipti Chhatrapati Tuesday, March 27, 2012 10:00 AM
Tuesday, March 27, 2012 8:18 AM
All replies
-
Create and Deploy a SharePoint WCF service for following things (http://msdn.microsoft.com/en-us/library/ff521581.aspx , http://nikspatel.wordpress.com/2012/02/29/step-by-step-building-custom-wcf-services-hosted-in-sharepoint-part-i/ ) :
- If you want to use the Complete support of SharePoint APIs
- If you want your client to access your service with the same experience as of SharePoint OOB services
- If you extend some custom functionality of your solution which is by default not provided by SharePoint services.
- If you want to use and provide the same authentication/authorization configured in the farm while accessing your service.
- If your service is getting used internally between the SharePoint farms.
- If you want to access the custom service internally for your Solution (client / server kind of architecture)
Go for a separate WCF service
- If this is just some functionality from your solution which you want to expose to outer world.
- You can only use the Client APIs / SharePoint webservice / or your custom code reference inside your WCF service.
- You have to take care of Authentication/autorization
- If can be accessed by some other client, without even knowing the existence of SharePoint in back-end.
Hope this helps to take a decision.
get2pallav
Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.- Marked as answer by Dipti Chhatrapati Tuesday, March 27, 2012 10:01 AM
Tuesday, March 27, 2012 6:30 AM -
Of couse use SharePoint project.
please refer to the manual: http://msdn.microsoft.com/en-us/library/ff521581.aspx
I also suggest you to use http://cksdev.codeplex.com/, it contains a WCF template.
上善若水Posting is provided "AS IS" with no warranties, and confers no rights.- Edited by Lambert Qin [秦磊] Tuesday, March 27, 2012 6:30 AM
Tuesday, March 27, 2012 6:30 AM -
Although I feel get2pallav has provided valuable info, I'd like to add my opinion as well. To me it depends on the following questions:
- If you need the service to run in the current SharePoint context, create a SharePoint project as discussed in the link a provide later.
- Otherwise, create a separate WCF service and run it in a separate (non-SharePoint) IIS web site.
- Consider to wrap a .NET 3.5 service in a separate WCF 4 service that uses TPL to speed up things (the back to the future pattern.
Everything is explained at: http://sharepointdragons.com/2011/10/07/parallel-programming-in-sharepoint-2010-the-back-to-the-future-pattern/
In addition, I've found that all answers contained useful info and I've promoted it to the following Wiki page: http://social.technet.microsoft.com/wiki/contents/articles/8665.sharepoint-2010-best-practices-where-to-publish-a-wcf-service.aspx
Kind regards,
Margriet BruggemanLois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com
- Edited by Margriet Bruggeman Tuesday, March 27, 2012 8:53 AM
- Marked as answer by Dipti Chhatrapati Tuesday, March 27, 2012 10:00 AM
Tuesday, March 27, 2012 8:18 AM -
Thanks to all of you for your valuable times :)
Dipti Chhatrapati
Tuesday, March 27, 2012 10:01 AM