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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

getting an error while calling the method.

(0) ShareShare
ReportReport
Posted on by 6

Hello All Experts,

I am getting below error while calling the code .

"An error occurred when verifying security for the message.";

Below is my code .

EntityCollection ec = new EntityCollection();
IOrganizationService org=null;

org = new OrganizationServiceClient();
((System.ServiceModel.ClientBase<ConsoleApplication1.MDDev02NS.IOrganizationService>)org).ClientCredentials.UserName.Password = "*****";
((System.ServiceModel.ClientBase<ConsoleApplication1.MDDev02NS.IOrganizationService>)org).ClientCredentials.UserName.UserName = "pqr";

QueryExpression qe = new QueryExpression();
qe.EntityName = "account";
qe.ColumnSet = new ColumnSet() { AllColumns = true };

ec=org.RetrieveMultiple(qe); // Error at this line...

can anyone help me resolving this.

*This post is locked for comments

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

    Hello,

    Please find following links --

    - community.dynamics.com/.../dynamics-crm-2011-quot-an-error-occurred-when-verifying-security-for-the-message-quot

    - community.dynamics.com/.../145481

    Hope this helps!

    [If you find any helpful answer(s) of your question, please mark the answer(s) as verified answer(s).]

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    It seems like you are missing the endpoint:

    string strURI = @"http://CRMServerName:defaultPort/&quot; + strOrg + "/XRMServices/2011/Organization.svc";

    System.ServiceModel.EndpointAddress epa= new System.ServiceModel.EndpointAddress(new Uri(strURI), System.ServiceModel.EndpointIdentity.CreateDnsIdentity(""));

    org.Endpoint.Address= epa;

    See the following article for more information:

    social.technet.microsoft.com/.../12209.crm-2011-how-to-use-organizationserviceclient-with-pure-wcf-call-no-xrm-dll.aspx

    Hope this helps.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans