CRM Dynamics IOrganizationService SOAP Execute fails with the latest SDK - soap

I have been using the latest Xrm sdk to access the metadata of my company's dynamics 365 account. This has been working well for some time, however it has broken all of a sudden roughly 3 weeks ago. There has been no code changes. This only means something has changed in their side.
Following is the code that has been used and it is very simple. The only information I have got till now is that their Security Protocol has changed to Tls12 and therefore tried to set that info before Organization Service object is created like so
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
But that has no influence either.
var sc = ServiceConfigurationFactory.CreateConfiguration<IOrganizationService>(new Uri("soap-url-from-365-developer-resources"));
var cc = new ClientCredentials();
cc.UserName.UserName = "username";
cc.UserName.Password = "password";
var organizationServiceProxy = new OrganizationServiceProxy(sc, cc);
organizationServiceProxy.EnableProxyTypes();
RetrieveAllEntitiesRequest request = new RetrieveAllEntitiesRequest()
{
EntityFilters = EntityFilters.Attributes,
RetrieveAsIfPublished = true
};
try
{
using (var organizationServiceContext = new CrmOrganizationServiceContext(organizationServiceProxy))
{
RetrieveAllEntitiesResponse response = (RetrieveAllEntitiesResponse)organizationServiceContext.Execute(request);
var entities = response.EntityMetadata
.Where(x => x.DisplayName.UserLocalizedLabel != null &&
!string.IsNullOrWhiteSpace(x.DisplayName.UserLocalizedLabel.Label)
)
.ToList();
}
}
catch (Exception ex)
{
Console.WriteLine("GetAllEntities {0}", ex.Message); }
The error during Execute is as follows
System.InvalidOperationException: Metadata contains a reference that cannot be resolved: 'https://macfar.crm4.dynamics.com/XRMServices/2011/Organization.svc?wsdl&sdkversion=9'. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.WriteHeaders(Boolean async)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Description.MetadataExchangeClient.MetadataLocationRetriever.DownloadMetadata(TimeoutHelper timeoutHelper)
at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)
--- End of inner exception stack trace ---
at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)
at System.ServiceModel.Description.MetadataExchangeClient.ResolveNext(ResolveCallState resolveCallState)
at System.ServiceModel.Description.MetadataExchangeClient.GetMetadata(MetadataRetriever retriever)
at Microsoft.Xrm.Sdk.Client.ServiceMetadataUtility.RetrieveServiceEndpointMetadata(Type contractType, Uri serviceUri, Boolean checkForSecondary)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1..ctor(Uri serviceUri, Boolean checkForSecondary)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceConfiguration..ctor(Uri serviceUri, Boolean enableProxyTypes, Assembly assembly)
at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateConfiguration[TService](Uri serviceUri, Boolean enableProxyTypes, Assembly assembly)
at Microsoft.Xrm.Sdk.Client.ServiceProxy`1..ctor(Uri uri, Uri homeRealmUri, ClientCredentials clientCredentials, ClientCredentials deviceCredentials)
I have tried everything that comes up googling this error message, however in vain. Therefore any help to work around this issue is greatly appreciated

There have been quite a few changes in the SDK compatibility in the last year.
You will need to make sure you have the right SDK version to match your .Net Framework and CRM versions.
Dynamics 365 SDK Backwards Compatibility
With the deprecation of Azure Access Control Service (ACS), we have to
modify our SDK authentication code by removing all references to ACS.
Effective from versions Microsoft Dynamics CRM Online 2016 Update 1
(v8.1.1) and Microsoft Dynamics 365 (v8.2), we removed Live ID support
and ACS dependencies on the server-side.
We also removed Microsoft.Xrm.Client from the CRM 2016 (8.x) SDK
client because it was not compliant with the OAuth changes, and
replaced it with Microsoft.Xrm.Tooling.Connector. You can use the
current Microsoft Dynamics 365 Software Development Kit (SDK) to
access Microsoft Dynamics CRM back to version 6.x for both auth and
messaging.
When upgrading to Dynamics 365, make sure you use the latest Microsoft
Dynamics 365 Software Development Kit (SDK). The following outlines
the current supported matrix for other SDK clients:

Related

"Installing MDriven Server on Windows" - cannot access local Turnkey

I have tried to install MDriven Server and Turnkey according to the page "Installing MDriven Server on Windows" (https://wiki.mdriven.net/index.php/Installing_MDriven_Server_on_Windows) and the Video (https://www.youtube.com/watch?time_continue=722&v=q0ppL5sMPGg).
Installed versions are MDrivenServer_20190411.zip and MDrivenTurnkey_20190415.zip
The PC is a Windows 2019 Server (also tried on Windows 10 Workstation, results are identical!).
I can open the MDriven Server pages (https://MyServer/MyTurnkeyApp/__MDrivenServer) everything looks fine, i.e.:
I created a new "a" user with a known PWD according to the Video
DB connectivity/check/evolve is fine
https/Self-signed SSL certificate works as expected
MDrivenServer works as expected and as described in the article & video!
However I cannot go to the Turnkey pages (https://MyServer/MyTurnkeyApp).
I always get an error message:
Server Error in '/MyTurnkeyApp' Application.
Not able to start, check the CurrentVersion - is it set? Check that the app is Started and not Paused. Check that the Version is in DatabaseUpdated state.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception: Not able to start, check the CurrentVersion - is it set? Check that the app is Started and not Paused. Check that the Version is in DatabaseUpdated state.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[Exception: Not able to start, check the CurrentVersion - is it set? Check that the app is Started and not Paused. Check that the Version is in DatabaseUpdated state.]
AppCompleteGeneric.ACApplication.GetStartedAndRunningFromDatabaseIdentity(EcoSpace adminEcoSpace, DatabaseIdentity databaseIdentity) in c:\capableobjectsbuild2017\source\AppCompleteGeneric\AppCompleteGeneric.Model\AppCompleteGeneric\ACApplication.cs:51
TurnKeyEcoSpaceWithModelFromServer.TurnKeyEcoSpaceCreator.GetBlank(String databaseID) in c:\capableobjectsbuild2017\source\StreamingApp\StreamingAppGenericAPIAndControllers\TurnKeyEcoSpaceCreator.cs:115
TurnKeyEcoSpaceWithModelFromServer.TurnKeyEcoSpaceCreator.BorrowEcoSpace(EcoSpaceRequestInfo requestInfo) in c:\capableobjectsbuild2017\source\StreamingApp\StreamingAppGenericAPIAndControllers\TurnKeyEcoSpaceCreator.cs:289
Eco.MVC.EcoController1.EnsureEcoSpace(String shelfKey) in c:\capableobjectsbuild2017\source\Eco\Eco.MVC\EcoController.cs:408
Eco.MVC.EcoController1.OnActionExecuting(ActionExecutingContext filterContext) in c:\capableobjectsbuild2017\source\Eco\Eco.MVC\EcoController.cs:549
Eco.MVC.ModelDrivenControllerBase1.OnActionExecuting(ActionExecutingContext filterContext) in c:\capableobjectsbuild2017\source\Eco\Eco.MVC\ModelDrivenControllerBase.cs:97
System.Web.Mvc.Async.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex) +261
System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__31(AsyncCallback asyncCallback, Object asyncState) +100
System.Web.Mvc.Async.WrappedAsyncResultBase1.Begin(AsyncCallback callback, Object state, Int32 timeout) +166
System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeActionMethodWithFilters(ControllerContext controllerContext, IList1 filters, ActionDescriptor actionDescriptor, IDictionary2 parameters, AsyncCallback callback, Object state) +333
System.Web.Mvc.Async.<>c__DisplayClass21.b__19(AsyncCallback asyncCallback, Object asyncState) +1151
System.Web.Mvc.Async.WrappedAsyncResultBase1.Begin(AsyncCallback callback, Object state, Int32 timeout) +166
System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +463
System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +42
System.Web.Mvc.Async.WrappedAsyncVoid1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +73
System.Web.Mvc.Async.WrappedAsyncResultBase1.Begin(AsyncCallback callback, Object state, Int32 timeout) +166
System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +906
System.Web.Mvc.Async.WrappedAsyncResultBase1.Begin(AsyncCallback callback, Object state, Int32 timeout) +166
System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +711
System.Web.Mvc.MvcHandler.b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +93
System.Web.Mvc.Async.WrappedAsyncVoid1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +73
System.Web.Mvc.Async.WrappedAsyncResultBase1.Begin(AsyncCallback callback, Object state, Int32 timeout) +166
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +522
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1020
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128
Any idea what's wrong?
Check this answer: MDriven Server installation
I think it is the same issue.
You have no model uploaded to mdriven server
or the model is not selected as current
or the app slot A0 is not started in mdriven server.

Login-AzureRmAccount Could not establish trust relationship for the SSL/TLS secure channel

I am trying to connect to Azure using Powershell. When I try the command Login-AzureRmAccount, I get a pop-up to enter my credentials. But, immediately after that I get an error:
Login-AzureRmAccount : Service returned error. Check InnerException for more details: The underlying connection was
closed: Could not establish trust relationship for the SSL/TLS secure channel.
At line:1 char:1
+ Login-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Add-AzureRmAccount], AadAuthenticationFailedException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.AddAzureRMAccountCommand
Can someone shed some light on this?
Update
The below inner exception is what I see:
'Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException:
Service returned error. Check InnerException for more details --->
System.Net.WebException: The underlying connection was closed: Could
not establish trust relationship for the SSL/TLS secure channel. --->
System.Security.Authentication.AuthenticationException: The remote
certificate is invalid according to the validation procedure. at
System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken
message, AsyncProtocolRequest asyncRequest, Exception exception) at
System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32
count, AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32
count, AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32
count, AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst,
Byte[] buffer, AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult
lazyResult) at
System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.WriteHeaders(Boolean async) --- End of
inner exception stack trace --- at
System.Net.HttpWebRequest.GetResponse() at
Microsoft.IdentityModel.Clients.ActiveDirectory.HttpWebRequestWrapper.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.IdentityModel.Clients.ActiveDirectory.HttpHelper.d__0
.MoveNext() --- End of inner exception stack trace --- at
Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.RunAsyncTask[T](Task1
task) at
Microsoft.Azure.Commands.Common.Authentication.UserTokenProvider.DoAcquireToken(AdalConfiguration
config, PromptBehavior promptBehavior, String userId, SecureString
password) at
Microsoft.Azure.Commands.Common.Authentication.UserTokenProvider.SafeAquireToken(AdalConfiguration
config, ShowDialog showDialog, String userId, SecureString password,
Exception& ex)
ErrorCode: service_returned_error
StatusCode: 501'. At line:1 char:1
+ Login-AzureRmAccount $Error[0].Exception.InnerException
I'm fairly certain this will bypass your problem but not actually solve it.
DISCLAIMER: This is not secure, and should only be done if you are certain that the certificate error you are getting is a false positive, or you truly don't care! This method leaves you open to establishing connections to malicious and/or compromised sites. This is the PowerShell equivalent to going to a web page in Internet Explorer, getting a certificate error, and clicking the Continue Anyway link.
If you try to manually login, and get a certificate error, but are ok with continuing past it then you can disable certificate checking in PowerShell so that it behaves similarly. Running this line before you try to login to Azure will disable certificate checking for the current session. You will have to run this each time you want to login to Azure, so long as there is a certificate error.
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
A better solution would probably be to resolve the SSL/TLS issue that you are seeing, but that is most likely something better suited for ServerFault or something.

OpsHub - User Mapping Screen throws error after long wait

Trying an OpsHub migration on TFS2013.3 to VSO, the utility fails on the User Mapping screen before any data can be shown. The screen's white areas stay blank and eventually after about 5 minutes, and error is thrown via an alert box.
OpsHub Version: Latest - downloaded and installed today, 1/23/2015.
The contents of my OSVMU.log file show this:
2015-01-23 14:00:41,442 [1] ERROR com.opshub.eai.metadata.MetadataException: OpsHub-014371: Could not instantiate metadata implementation for For User List | TFS Source 1422039041211 ALM TFS 1422039041213, due to ; nested exception is:
java.net.SocketTimeoutException: Read timed out
System.ServiceModel.FaultException: com.opshub.eai.metadata.MetadataException: OpsHub-014371: Could not instantiate metadata implementation for For User List | TFS Source 1422039041211 ALM TFS 1422039041213, due to ; nested exception is:
java.net.SocketTimeoutException: Read timed out
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
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 TFSMigrationUI.ViewModel.UserMappingViewModel.worker_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e) in e:\OVSMUBranch\TFSMigrationUI\ViewModel\UserMappingViewModel.cs:line 416
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
I don't know how or why, but I deleted the VSO server registration using Visual Studio, and re-added it back via Visual Studio, and this seemed to correct the ObsHub Utility, because now it correctly pulls in all the users / mappings.

Google.Apis.Http.ConfigurableMessageHandler exception at runtime

I have problem with Google Analytics API .NET.
While connecting to GA via api at line
var certificate = new X509Certificate2(pathToPrivateKey, passToPrivateKey, X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(new ServiceAccountCredential.Initializer(serviceAccountEmailAddress)
{
Scopes = scopes
}.FromCertificate(certificate));
It give below error
Message=The type initializer for 'Google.Apis.Http.ConfigurableMessageHandler' threw an exception.
Source=Google.Apis.Core
TypeName=Google.Apis.Http.ConfigurableMessageHandler
StackTrace:
at Google.Apis.Http.ConfigurableMessageHandler..ctor(HttpMessageHandler httpMessageHandler)
at Google.Apis.Http.HttpClientFactory.CreateHttpClient(CreateHttpClientArgs args) in c:\code\google.com\google-api-dotnet-client\default\Tools\Google.Apis.Release\bin\Debug\test\default\Src\GoogleApis.Core\Apis\Http\HttpClientFactory.cs:line 37
at Google.Apis.Auth.OAuth2.ServiceAccountCredential..ctor(Initializer initializer) in c:\code\google.com\google-api-dotnet-client\default\Tools\Google.Apis.Release\bin\Debug\test\default\Src\GoogleApis.Auth.DotNet4\OAuth2\ServiceAccountCredential.cs:line 217
at ConsoleApplication3.Program.AuthenticationGA(String pathToPrivateKey, String serviceAccountEmailAddress, String passToPrivateKey) in C:\Documents and Settings\pivotaladmin.WA-PIV\my documents\visual studio 2010\Projects\ConsoleApplication3\ConsoleApplication3\Program.cs:line 30
at ConsoleApplication3.Program.Main(String[] args) in C:\Documents and Settings\pivotaladmin.WA-PIV\my documents\visual studio 2010\Projects\ConsoleApplication3\ConsoleApplication3\Program.cs:line 69
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.FileLoadException
Message=Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Source=Google.Apis.Core
FileName=System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
FusionLog==== Pre-bind state information ===
Project type: Console app
.NET Framework 4.0
MS Visual Studio 2010 Express
Windows Server 2003
I tried the same code on Windows 7 and it works.
I have no idea what goes wrong.
Any idea?
It looks like your main problem is the inner exception you got:
InnerException: System.IO.FileLoadException
Message=Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies.
The good news is that you should just install the following patch: KB2468871, as suggested here:
Could not load file or assembly System, Version=2.0.5.0 in .NET 4 MVC 4 application

SOAP Security negotiation Error while calling Microsoft Dynamics CRM 2011 sdk IOrganizationServiceProxy web service

we have a virtual machine in our company that contains sqlserver and crm 2011 installed on It which we use It for testing our codes and I have written a simple webservice to call the sdk IOrganizationServieProxy webservice . on this Virtual machine my code works perfeclty with no error . BUT here is the situation : we have two other virtual machines , on one of them the sql server is installed and on the other one crm is installed and configured . the crm works fine but when I try to use my web service which calls the crm sdk IOrganizationServieProxy webservice webmethods I get the following errorr , any Ideas what could be wrong ? thanks in advance for anyone who answears this question .
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)
and here is an image from my visualstudio debug mode which shows the error :
It may not apply, but I have run into problems when the URL I used didn't match the WCF bindings set in the CRM Deployment Manager.
For instance, a server named "MyCRMServer" might be listening on port 80 at:
http://MyCrmServer/
...but if I had changed my CRM Server in Deployment Manager to url "crm.myCompany.com" then I have to use this URL to access web services:
http://crm.myCompany.com/