SharePoint: An exception occurred when trying to issue security token. This is often caused by an incorrect address or SOAP action.

I experienced this error while integrating SharePoint with CRM 2011. Below is the error message:

An exception occurred when trying to issue security token: There was no endpoint listening at http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

This error can occur if you have not started SharePoint services.

Solution:

Make sure you have started required SharePoint Server Services… Go to SharePoint Site and click on Manage Services on Server. You will be presented with a list of SharePoint services. Start the required services if any service is Stopped.

Sharepoint Manage Services on Server

SharePoint Manage Services on Server