I am trying to access the WCF service (MS CRM 2011) and get the above error. If I run my trial program from the VS2010 debugger using Cassini or IIS Express, it works fine. Authentication errors.
However, if I publish the site in my local IIS 7.5 (running the 64-bit version of Windows 7), I get an error on the line that captures the CRM UserId (WhoAmIResponse).
I opened Fiddler to compare requests between running under the debugger and running in IIS. On a site running under IIS, the request never occurs, so it must be unsuccessful before going this far.
A site published in IIS has its own set of web.config for ...
<authentication mode="Windows"> </authentication> <identity impersonate="true"/>
The site runs under the pre-installed ASP.NET v4.0 application pool, built-in pipeline, ApplicationPoolIdentity account.
Here is my code ...
public class DemoController : Controller { public ActionResult Index() { ClientCredentials credentials = new ClientCredentials(); credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials; var _serviceProxy = new OrganizationServiceProxy(new Uri("http://svr-rex2011-dev/TimeEntry/XRMServices/2011/Organization.svc"), null, credentials, null);
Any ideas? Very much appreciated !!!
source share