Dynamics CRM 2011 Online, CrmSvcUtil, proxy authentication

Trying to write a plugin for Dynamics CRM 2011 Online.

The first step is to use CrmSvcUtil to generate code for entity classes.

I think I have CrmSvcUtil parameters (see below), but when I run it, I get:

Exit the program with the exception: metadata contains a link that cannot be resolved: ' https://myorg.crm.dynamics.com/XRMServices/2011/Organization.svc?wsdl '. Turn on tracing and view trace files for more information.

Enabling tracing (via CrmSvcUtil.exe.config) detects this error:

---> System.Net.WebException: the remote server returned an error: (407) Proxy authentication required.
in System.Net.HttpWebRequest.GetResponse ()
in System.ServiceModel.Description.MetadataExchangeClient. MetadataLocationRetriever.DownloadMetadata (TimeoutHelper timeoutHelper)
etc.

This makes sense because there is a proxy server on the network I'm working on that requires a username / password to connect to the Internet. Naturally, this username / password is different from Dynamics CRM.

So, how do I get CrmSvcUtil to pass the correct username / password to the proxy?

Here is the configuration file that I use with CrmSvcUtil:

<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="url" value="https://myorg.crm.dynamics.com/XRMServices/2011/Organization.svc"/> <add key="codeCustomization" value="Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"/> <add key="out" value="XRM\Xrm.cs"/> <add key="namespace" value="Xrm"/> <add key="username" value=" myusername@fordynamics.com "/> <add key="password" value="mydynamicspassword"/> <add key="deviceid" value="my device ID"/> <add key="devicepassword" value="my device password"/> <add key="servicecontextname" value="XrmServiceContext" /> <add key="servicecontextprefix" value="Xrm" /> </appSettings> <system.diagnostics> <trace autoflush="false" indentsize="4"> <listeners> <add name="configConsoleListener" type="System.Diagnostics.ConsoleTraceListener"> <filter type="System.Diagnostics.EventTypeFilter" initializeData="Error" /> </add> </listeners> </trace> </system.diagnostics> </configuration> 
+6
source share
2 answers

Yeah! I think I hacked it.

I added the following to the CrmSvcUtil.exe.config file:

 <system.net> <defaultProxy useDefaultCredentials="true"> <proxy proxyaddress="http://proxyaddress:port" /> </defaultProxy> </system.net> 

I no longer get the proxy authentication error.

(I get different errors, but about missing assemblies, so I think I can probably figure it out.)

+6
source

I had the same error and my problem was that the firewall blocked outgoing connections from CrmSvcUtil!

0
source

Source: https://habr.com/ru/post/909547/


All Articles