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

web services using crm

$
0
0

When i tried to consume  the online crm services   (https://orgname.api.crm8.dynamics.com/XRMServices/2011/Organization.svc?wsdl

in my console application for crud operation.But i keep getting an error  -"An error occurred when verifying security for the message".

i have searched for the error it may be because of the time zone,but i did tried to change the time zone of my crm & pc but still not working.any idea on this one.

code:

 String strURI = "orgname.api.crm8.dynamics.com/.../Organization.svc";
            try
            {
                OrganizationServiceClient client = new OrganizationServiceClient();
                client.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("username", "password", "orgname.crm8.dynamics.com");
                System.ServiceModel.EndpointAddress myEndpointAdd = new System.ServiceModel.EndpointAddress(new Uri(strURI), System.ServiceModel.EndpointIdentity.CreateDnsIdentity(""));
                client.Endpoint.Address = myEndpointAdd;
                Entity t = new Entity();
                t.LogicalName = "Account";
                AttributeCollection myAttColl = new AttributeCollection();
                myAttColl.Add(new KeyValuePair<string, object>("name", "test from console"));
                t.Attributes = myAttColl;
                client.Create(t);
                Console.ReadLine();
                client.Close();
            }            catch (Exception e) { Console.WriteLine(e.Message); }

            


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images