Thursday, 2 February 2012

Microsoft Dynamics CRM 2011 – Error When Browsing Discovery.svc Service

Reference
http://yellowduckguy.wordpress.com/2012/02/03/microsoft-dynamics-crm-2011-error-when-browsing-discovery-svc-service/

Today I had to resolve a customer issue where the Dynamics CRM 2011 for Outlook Configuration Wizard could not find the CRM 2011 server and the CRM server did exist on the domain.



I was connecting Microsoft Outlook 2007 to CRM 2011 via the installed add-in Microsoft Dynamics CRM 2011 for Outlook.

My list of areas to troubleshoot this issue was as follows:
•Check CRM 2011 server is running ok. Can I browse it from the CRM Server?
•Check I can ping the CRM server from the Outlook client PC
•Check I can browse to CRM from the web browser on the Outlook client PC
•Check I can resolve the Discovery.svc service. CRM for Outlook Configuration tool uses this.
•Check the registry settings for the Configuration settings of CRM for Outlook

The Issue
Going through this list I found I could not resolve the Discovery.svc service from the Outlook client PC. You should be able to resolve the Discovery.svc service using the following URL. http://[yourcrmserver]/XRMServices/2011/Discovery.svc You should see a page similar to below when you can successfully render the Discovery Service.

So I thought I had a possible IIS issue as I couldn’t render the service on the CRM server as well. I decided to check the Event Viewer first for any clues. Below is the error message I received.

WebHost failed to process a request.
Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/63835064
Exception: System.ServiceModel.ServiceActivationException: The service ‘/XRMServices/2011/Discovery.svc’ cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting ‘system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled’ to true or specifying ‘system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters’.
Parameter name: item. —> System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting ‘system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled’ to true or specifying ‘system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters’.
Parameter name: item
at System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item)
at System.Collections.Generic.SynchronizedCollection`1.Add(T item)
at System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses)
at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
at Microsoft.Crm.Sdk.V5.DiscoveryServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
— End of inner exception stack trace —
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)
Process Name: w3wp
Process ID: 4116
From this error message it seems their is a http bindings issue within IIS. Then it came to me! One of our infrastructure guys had created another port binding for CRM to be on port 80 for some other unrelated testing.
Resolution
Therefore to resolve this I had to remove the extra http binding in the Microsoft Dynamics CRM website within IIS. To change or investigate your site bindings, click on
Bindings…
under
Edit Site
in IIS as shown below.

You should only have one http binding in the list as shown below. Note: I have removed the binding which was causing the problem in the image below.

Its possible to have multiple http bindings, but you will need to change some web.config values which contain
multipleSiteBindingsEnabled
and set it to
true
. See the error message earlier for more information. Hope that helps! Greg Olsen

No comments:

Post a Comment