Monday, February 10, 2014

How to get the url for a SharePoint EndPoint hosted in a Service Application

Hi All,

This blog post is for SharePoint exposed EndPoints through Service Applications. If you are developing or deploying a custom Service Application in SharePoint 2010/2013 and you are exposing a WCF EndPoint Service EndPoint through the service application this blog post is helping you how to identify and get the Url for the exposed WCF EndPoint.

You need to test and make sure that the service application is working properly before checking any client application or webpart code that is consuming or integrating with this endpoint. Specially, if your endpoint might be having issues related to assembly dependencies or missing files that causes the service application to throw exceptions when it is being called from the client applications.

When you develop a service application in VS 2012/2013, the service application creates an application pool in the IIS, since you give it a name when you install it, and this expose a service instance where you can access it through a url!

To develop Service application for SharePoint 2010/2013, I strongly recommend this starter kit since it gives you a lot of ground work is done for you and you just need to code your logic in it.

http://chocolatey.org/packages/sastarterkitvs2012

Great shout out to Adam Toth !

So the question that needs an answer is:

What is the Url for the exposed WCF end point service that is hosted in a SharePoint Service Application?

1) You need to know the Service Application GUID that is installed in your farm, to do this Open SharePoint PowerShell and write below cmdlet:

Get-SPServiceApplication | select id,name

This will list all deployed service applications and provides the Service Application GUIDs.



2) Open IIS Manager, Expand SharePoint Web Services.
3) Look for the GUID that is associated with your service application.
4) Select the your endpoint and click on the browse from the IIS manager right pane.
5) Add the endpoint name "WcfEndPoint.svc" to the url !

http://localhost:32843/c20d8cbe444f4334a212ccba687dfbd7/MYWCFEndPoint.svc

Enjoy!









Post a Comment