I'm working on putting together a custom service application and I'm seeing the aforementioned error: "There is no default service endpoint for service application"
The full stack trace is below:
Microsoft.SharePoint.SPException: There is no default endpoint for this application.
at Microsoft.SharePoint.SPConnectedServiceApplication.get_ApplicationAddresses()
at Microsoft.SharePoint.SPServiceLoadBalancer.<get_EndpointAddresses>d__0.MoveNext()
at Microsoft.SharePoint.SPRoundRobinServiceLoadBalancer.GetEndpoints(IEnumerable`1 applicationAddresses)
at Microsoft.SharePoint.SPRoundRobinServiceLoadBalancer.BeginOperation()
at My.Namespace.Config.Clients.ConfigurationServiceClient.ExecuteOnChannel(ExecuteOnChannelDelegate lambda)
at My.Namespace.Config.Clients.ConfigurationServiceClient.GetDbConnectionString()
at My.Namespace.UI.ConfigurationTest.ConfigurationTestUserControl.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at My.Namespace.UI.ConfigurationTest.ConfigurationTest.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The error is originating from a web part which is calling through a WCF client to the service.
Here's the codebehind for the webpart (very basic; just for testing purposes):
namespace My.Namespace.UI.ConfigurationTest
{
public partial class ConfigurationTestUserControl : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
ConfigurationServiceClient client = new ConfigurationServiceClient(SPServiceContext.Current);
string connectionString = client.GetDbConnectionString();
_connectionString.Text = connectionString;
}
}
}
It just tests reading a value from the service application (a database connection string).
The relevant section of code where the error is being raised in the WCF client is below:
private void ExecuteOnChannel(ExecuteOnChannelDelegate lambda)
{
if (lambda == null)
{
throw new ArgumentNullException("lambda");
}
ConfigurationServiceApplicationProxy proxy =
(ConfigurationServiceApplicationProxy) _context.GetDefaultProxy(typeof(ConfigurationServiceApplicationProxy));
if (proxy == null)
{
throw new InvalidOperationException("The IC configuration proxy was not found.");
}
SPServiceLoadBalancer loadBalancer = proxy.LoadBalancer;
if (loadBalancer == null)
{
throw new InvalidOperationException("Could not locate the load balancer");
}
SPServiceLoadBalancerContext loadBalancerContext = loadBalancer.BeginOperation();
// ADDITIONAL CODE OMITTED...
}
It's exactly on the loadBalancer.BeginOperation()
call.
Any ideas would be appreciated. Most searches turn up issues with WCF configuration, however, I'm not sure that this is the case here as it is being raised from SharePoint so it seems that there may be some key point I'm missing with regards to the service client/application and registering the endpoints.
The service is started in "Manage services on server", there is an instance in "Manage service applications", and there is a proxy associated with the web application under "Configure service application associations". Those settings seem to be all in order. Just trying to figure out where else I can look to try to troubleshoot this.