Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

asked on

dynamics crm 365 cloud

I have Dynamics CRM 365 Cloud and also asp.net web app project and try to add below codes in page load
and get this message: An error occurred when verifying security for the message.

I know the login/password is 100% correct. not sure What I am missing. All i want is to get the lead list.


            CRMServ.OrganizationServiceClient client = new CRMServ.OrganizationServiceClient();
            client.ClientCredentials.UserName.UserName = userID;
            client.ClientCredentials.UserName.Password = password;                       
            QueryByAttribute qe = new QueryByAttribute("lead");
 Response.Write(ret.Entities[0].ToString());

Open in new window

Avatar of HainKurt
HainKurt
Flag of Canada image

looks like you need to pass some properties here

 CRMServ.OrganizationServiceClient(???)

what parameters does it accept?

check this sample, does it apply to you?

https://msdn.microsoft.com/en-us/library/hh675404.aspx
Avatar of ITsolutionWizard

ASKER

I already passed all...did u try to run the codes on your end?
SOLUTION
Avatar of Rikin Shah
Rikin Shah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That is full codes
looks like you need to add uri/server/ip somehow...
without those, how that code will connect to the service? username/password is second step, 1st is the destination...
Hi,

It still looks unfinished. Please make sure you complete your code. I can see object "ret" is not defined/initialized anywhere.

Also, please mention which CRM version you're using Online or On Premise?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
On cloud 365
Proper method to connect Dynamics 365 via asp.net