-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error trying to connect to Server: Metadata contains a reference that cannot be resolved #1
Comments
@ariskemper It looks like a name resolution failure based on your trace.
Have you tried downloading the wsdl first, and check if there are references to other servers? Sometimes the wsdl has references to other data types (like .xsd files) which might be returned using server names. Try adding those to your /etc/hosts file. |
@ariskemper , this definitely looks like a network issue. There are some tweaks in the above article that may help. Anyway, would you be able to compile a .net console application to see if it connects well to your CRM server? I can send you the code if you want. |
@crisfervil we will also try module with Dynamics CRM 2016. You could send me the .net console application code. Thanks |
@ariskemper , is just a simple piece of code to test if it connects properly. Add the CRM dlls, compile and run. If it connects successfully, the problem must be DynamicsIntegration. References to be added, from CRM sdk: Microsoft.Xrm.Client using Microsoft.Crm.Sdk.Messages;
using Microsoft.Xrm.Client;
using Microsoft.Xrm.Client.Services;
using System;
using System.Net;
namespace DynamicsIntegrationTest
{
class Program
{
static void Main(string[] args)
{
string connectionString = "Url=http://crm.contoso.org/MyOrgName";
WebRequest.DefaultWebProxy = WebRequest.GetSystemWebProxy();
WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;
// Establish a connection to the organization web service using CrmConnection.
var connection = CrmConnection.Parse(connectionString);
var orgService = new OrganizationService(connection);
// Test the connection
var userId = ((WhoAmIResponse)orgService.Execute(new WhoAmIRequest())).UserId;
Console.WriteLine("Connection successful!");
Console.Read();
}
}
} |
@crisfervil: Tested with Dynamics CRM 2016. Running this code i get: Unhandled Exception: |
@ariskemper The problem may be related either to the CRM deployment or the network configuration. Could you try to access to another CRM server from the same machine? For example a CRM online. This will discard problems with the Server configuration. Also you can try to run the same DynamicsIntegration script from another PC in the same network. Also a test in a Windows PC may discard issues with Mono or the Ubuntu configuration. Thanks, |
I tried to connect and works on Windows machine which is in the same network and domain. In Ubuntu problem still exist even, if i used powerbroker (pbis) to join machine in domain. |
i am getting the same error, running code on https://tonicdev.com/npm/dynamicsnode |
@pradeep-mishra , I got the same error while connecting to online CRM 2016. Fix for my problem. Added below section in config file and worked.
|
@avinashlanka Thanks for the info. Where did you add that config file? @pradeep-mishra what OS are you connecting from? |
@crisfervil , I was trying to create Organization proxy for online instance through my companies network (code written in console application - same code as above). To solve, |
@avinashlanka |
@hanpeic I'm afraid this project won't work in Mono, due to a couple of bugs not yet resolved and a few missing WPF libraries. I have my hopes in .net Core to be able to run this in Ubuntu, but again, we still need to wait until the System.Xaml.dll is available in the platform. Why System.Xaml.dll ? There's a dependency to this dll in one of the CRM SDK Assemblies (Microsoft.Xrm.Sdk.Workflow), and even though none of the DynamicsNode code references Workflows, this library is still required when a connection to the server is made. What version of CRM are you trying to connect to? There's a Web Api endpoint available in CRM, that would be very simple to interact with using node. More info here: https://msdn.microsoft.com/en-us/library/mt593051.aspx |
@crisfervil |
Update Microsoft.Xrm.Sdk.dll OR Use this code above connection string ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; |
I tried your module on Linux Ubuntu 14.04 with latest Mono 4.2 calling external on premise dynamics crm 2015. When checking, if XRMServices/2011/Organization.svc?wsdl&sdkversion=7.1 is available via url, it is accessible. I get following error, when trying to access it.
Error: Error trying to connect to Server: Metadata contains a reference that cannot be resolved : http://crmsrv.example.com:5555/XRMServices/2011/Organization.svc?wsdl&sdkversion=7.1
System.InvalidOperationException: Metadata contains a reference that cannot be resolved : http://crmsrv.example.com:5555/XRMServices/2011/Organization.svc?wsdl&sdkversion=7.1 ---> System.ServiceModel.EndpointNotFoundException: System error. ---> System.Net.WebException: Error: NameResolutionFailure
at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) <0x4025ab40 + 0x00117> in :0
at System.ServiceModel.Channels.HttpRequestChannel+c__AnonStorey1.<>m__0 (IAsyncResult r) <0x4025a730 + 0x000ae> in :0
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_remoting_wrapper (intptr,intptr)
at (wrapper remoting-invoke) System.ServiceModel.Description.IMetadataExchange:Get (System.ServiceModel.Channels.Message)
at System.ServiceModel.Description.MetadataExchangeClient.GetMetadataInternal (System.ServiceModel.EndpointAddress address, MetadataExchangeClientMode mode) <0x401d4290 + 0x0024e> in :0
--- End of inner exception stack trace ---
at System.ServiceModel.Description.MetadataExchangeClient.GetMetadataInternal (System.ServiceModel.EndpointAddress address, MetadataExchangeClientMode mode) <0x401d4290 + 0x002f7> in :0
at System.ServiceModel.Description.MetadataExchangeClient.GetMetadata (System.Uri address, MetadataExchangeClientMode mode) <0x401d3df0 + 0x0005b> in :0
at Microsoft.Xrm.Sdk.Client.ServiceMetadataUtility.RetrieveServiceEndpointMetadata (System.Type contractType, System.Uri serviceUri, Boolean checkForSecondary) <0x401cea20 + 0x00297> in :0
at Error (native)
at :1:55
at new CRMClient (/home/deploy/Projects/crm-rest/dynamicsintegration/node_modules/dynamicsintegration/CRM/CRMClient.js:34:26)
at Object. (/home/deploy/Projects/crm-rest/dynamicsintegration/test.js:3:11)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:117:18)
The text was updated successfully, but these errors were encountered: