1

我们公司有一台虚拟机,其中安装了 sqlserver 和 crm 2011,我们用它来测试我们的代码,我编写了一个简单的 web 服务来调用 sdk IOrganizationServieProxy webservice。在这台虚拟机上,我的代码可以完美运行,没有错误。但情况是这样的:我们有另外两台虚拟机,其中一台安装了 sql server,另一台安装并配置了 crm。crm 工作正常,但是当我尝试使用调用 crm sdk IOrganizationServieProxy webservice webmethods 的 web 服务时,出现以下错误,任何想法可能有什么问题?提前感谢任何回答这个问题的人。

    System.ServiceModel.Security.SecurityNegotiationException: SOAP security negotiation with 'http://localhost/KN/XRMServices/2011/Organization.svc' for target 'http://localhost/KN/XRMServices/2011/Organization.svc' failed. See inner exception for more details. ---> System.ComponentModel.Win32Exception: The Security Support Provider Interface (SSPI) negotiation failed.
   at System.ServiceModel.Security.WindowsSspiNegotiation.GetOutgoingBlob(Byte[] incomingBlob, ChannelBinding channelbinding, ExtendedProtectionPolicy protectionPolicy)
   at System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)
   at System.ServiceModel.Security.IssuanceTokenProviderBase`1.GetNextOutgoingMessage(Message incomingMessage, T negotiationState)
   at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
   --- End of inner exception stack trace ---

Server stack trace: 
   at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
   at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
   at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Xrm.Sdk.IOrganizationService.RetrieveMultiple(QueryBase query)
   at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveMultipleCore(QueryBase query)
   at KNCRMSearchWebService.searchContactsByNameAndFamilyName(String cl, String Name, String Family)

这是来自我的visualstudio调试模式的图像,显​​示了错误:

在此处输入图像描述

4

1 回答 1

3

它可能不适用,但是当我使用的 URL 与 CRM 部署管理器中设置的 WCF 绑定不匹配时,我遇到了问题。

例如,名为“MyCRMServer”的服务器可能正在侦听端口 80:

http://MyCrmServer/

...但是如果我在 Deployment Manager 中将 CRM 服务器更改为 url “crm.myCompany.com”,那么我必须使用此 URL 来访问 Web 服务:

http://crm.myCompany.com/
于 2012-10-26T12:46:01.810 回答