SharePoint 2013 : Load balancer could not find the endpoint for… (SPEndpointAddressNotFoundException)

Stupeur et tremblement dans les ULS…
sharepoint2013
This kind of warning can occur with any service application. It means that the application (under IIS) is not running or does not exist !
How can I check ?
When you create a new service application, you should always check that it is actually running under IIS :

  • Get the Service Application ID (SharePoint 2013 Management Shell) :
  • (Get-SPServiceApplication -name "WorkManagementServiceApp").Id
    SPEndpointAddressNotFoundException_Capture_1

  • Launch IIS Manager (inetmgr.exe) , and check if the web application exists under « SharePoint Web Services » :
  • SPEndpointAddressNotFoundException_Capture_2

  • Also check if the associated application pool is running

What Happened ?
If you created your service application with Powershell, there is a chance that it has not been provisioned.
The command « Get-SPServiceApplication » might return something, but there’s no app in IIS ! This article explains it with more details.
See that example that creates a Work Management Service :

# Get the App Pool Account :
$appPoolAccount = Get-SPManagedAccount "DOMAINSPServices"
New-SPServiceApplicationPool -Name "WorkManagementProxyApplicationPool" -Account $appPoolAccount
$appPool = Get-SPServiceApplicationPool "WorkManagementProxyApplicationPool"
# Create the Service Application :
New-SPWorkManagementServiceApplication -Name "WorkManagementService" -ApplicationPool $appPool
$serviceApp = Get-SPServiceApplication -name "WorkManagementService"
# Create Proxy
New-SPWorkManagementServiceApplicationProxy -name "WorkManagementServiceProxy" -ServiceApplication $serviceApp -DefaultProxyGroup

Solution
Is that enough ? No, it isn’t. You should provision it :

$serviceApp.Provision()

A few minutes later, you should see the web application and the application pool runnning in IIS.