Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Hi, help me to write connection part(credential part) of console application for CRM 2011

$
0
0

I am unable to connect . Here is code .

CODE:

OrganizationServiceProxy proxy;

           ClientCredentials deviceCredentials = null;

           ClientCredentials clientCredentials = null;

           Guid contactId = Guid.Empty;

           //Organization URL

           Uri OrganizationUri = new Uri("crm14.api.crm5.dynamics.com/.../Organization.svc");

           //Discovery URL

           Uri HomeRealmUri = new Uri("disco.crm5.dynamics.com/.../Discovery.svc");

           //Setting Client Credentials

           clientCredentials = GetCredentials("kar.ayush@crm14.onmicrosoft.com", "ayush.9255");

           //Get the Device Id and Password

           deviceCredentials = GetDeviceCredentials();

           //Using Organization Service Proxy to instantiate the CRM Web Service

           using (proxy = new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, clientCredentials, deviceCredentials))

           {

               // This statement is required to enable early-bound type support.

               proxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());

               IOrganizationService service = (IOrganizationService)proxy;


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>