本文介绍了CRM 2011 SecurityNegotiationException试图访问Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图连接到CRM 2011 Web服务时,遇到了一个意外的错误。这里的背景:

Getting an unexpected error when trying to connect to CRM 2011 web service. Here's the background:

连接字符串(删除敏感信息):ServiceUri = HTTPS://crmdomain.com/OrgName/XRMServices/2011 /Organization.svc; URL = HTTPS://crmdomain.com/OrgName;用户名= appusername;密码=隐藏/>

Connection String (with sensitive info removed): "ServiceUri=https://crmdomain.com/OrgName/XRMServices/2011/Organization.svc; Url=https://crmdomain.com/OrgName; Username=appusername; Password=hidden"/>

创建连接如下:


  1. 解析康恩串入CRMConnection: VAR康恩= Microsoft.Xrm.Client.CrmConnection.Parse(CONNSTRING); (在这一点上,在 CrmConnection 对象的属性看起来是正确的,包括ClientCredentials)

  2. 创建组织代理: VAR orgProxy =新OrganizationServiceProxy(conn.ServiceUri,conn.HomeRealmUri,conn.ClientCredentials,conn.DeviceCredentials);

  3. 创建数据上下文: VAR背景=新MyContext(orgProxy);

  1. Parse conn string into CRMConnection: var conn = Microsoft.Xrm.Client.CrmConnection.Parse(connString); (at this point, the properties in the CrmConnection object look correct, including ClientCredentials)
  2. Create org proxy: var orgProxy = new OrganizationServiceProxy(conn.ServiceUri, conn.HomeRealmUri, conn.ClientCredentials, conn.DeviceCredentials);
  3. Create data context: var context = new MyContext(orgProxy);

在这一点上,从背景检索所有数据时,会出现以下WCF异常:

At this point, when retrieving any data from context, the following WCF exception occurs:

System.ServiceModel.Security.SecurityNegotiationException发生
消息= 调用者没有被验证服务
来源= mscorlib程序
堆栈跟踪:
服务器堆栈跟踪:
在System.ServiceModel.Security.IssuanceTokenProviderBase'1.DoNegotiation(时间跨度超时)
在System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(时间跨度超时)
。在System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(时间跨度超时)

System.ServiceModel.Security.SecurityNegotiationException occurred Message=The caller was not authenticated by the service. Source=mscorlib StackTrace: Server stack trace: at System.ServiceModel.Security.IssuanceTokenProviderBase'1.DoNegotiation(TimeSpan timeout) at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout) at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)

...等

的InnerException 显示 IsSenderFault = TRUE IsPredefinedFault = TRUE

这是怎么回事吗?

推荐答案

您可能想通过使用CRM跟踪缩小在CRM确切的错误。您可以激活CRM跟踪与href=\"http://mscrmtools.blogspot.com/2011/04/new-tool-crmdiagtool-2011.html\" rel=\"nofollow\">专用工具和

You might want to narrow down the exact error in CRM by using the CRM trace. You can activate the CRM trace with a dedicated tool and search it for more detailed information about the source of the exception. Note that the trace files get very big very fast, so it is reasonable to trace only during the webservice call.

这篇关于CRM 2011 SecurityNegotiationException试图访问Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 14:54