web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

web services using crm

(0) ShareShare
ReportReport
Posted on by

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); }

            

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    IOrganizationService service;

    String SoapOrgServiceUri = "orgname.crm.dynamics.com/.../Organization.svc&quot;;

               ClientCredentials credentials = new ClientCredentials();

               credentials.UserName.UserName = "username";

               credentials.UserName.Password = "password";

               Uri serviceUri = new Uri(SoapOrgServiceUri);

               OrganizationServiceProxy proxy = new OrganizationServiceProxy(serviceUri, null, credentials, null);

               proxy.EnableProxyTypes();

               service = (IOrganizationService)proxy;

    use this service object to do the crude operations like create/update/delete

  • ganeshm Profile Picture
    on at

    Thanks Vikas Saxena 

    why "OrganizationServiceClient" does not work.Is there any explanation.

  • Verified answer
    Community Member Profile Picture
    on at

    We use OrganizationServiceClient when we do not want to use SDK for CRM. Frankly, I have never used OrganizationServiceClient and have always used SDK to connect to the CRM.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans