从网站查询CRM Web服务

时间:2011-04-27 15:36:47

标签: dynamics-crm-2011

我开发了一个aspx网站,它使用OrganizationServiceProxy和OrganizationServiceContext来查询CRM webservice 在我的localhost中它会很好但是当我在服务器中部署网站时我有一个例外

ClientCredentials credentials = new ClientCredentials();
credentials.Windows.ClientCredential = (NetworkCredential)System.Net.CredentialCache.DefaultCredentials;
OrganizationServiceProxy _service = new OrganizationServiceProxy(new Uri("http://../XRMServices/2011/Organization.svc"), null, credentials, null);

OrganizationServiceContext _context = new OrganizationServiceContext(_service);

WhoAmIRequest userRequest = new WhoAmIRequest();

WhoAmIResponse userResponse = (WhoAmIResponse)_service.Execute(userRequest);

1 个答案:

答案 0 :(得分:0)

我问了同样的问题here。显然,Windows凭证不是OrganizationServiceProxy所期望的。