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

Simple Hello World - CRM Online API, not so simple

$
0
0

Hello,

I'm trying to get a simple hello world going using C# and the CRM Dynamics Online API. I can't get past the authentication (one of the first steps).

I'm probably missing something simple, it's just a matter of figuring out what.

What I've done is download the SDK and I've tried /samplecode/cs/solutions/solutions.sln (I've tried the quickstart project too but it shares the same helpercode).

The app starts and I use the default of crm.dynamics.com for the URL.  That generates the following url: https://disco.crm.dynamics.com/XRMServices/2011/Discovery.svc. In a web browser that works correctly. The next question is whether it's an Office 365 accounts. Selecting yes doesn't ask for credentials and throws an error Object reference not set to an instance of an object.  That fails on serviceManagement.Authenticate(authCredentails.  And answering no does ask for credentials and it fails with "An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. Authentication Failure".

So it appears that it's just an authentication issue which is what the inner exception says ("Authentication Failure").

The user account that I'm using is my CRM account. I'm a system administrator and I've assigned myself to every role. Is there any other setting where I need to approve my user for API access?  I also tried a custom account created for the purpose for a service call, but my testing has reverted back to my system admin account.

I also found some online developer training which walks through creating my own fresh project to make the auth call.  I followed that and it fails in essentially the same way.

Something else that is interesting is that the following works: https://{myorg}.api.crm.dynamics.com/XRMServices/2011/Organization.svc, but clicking on the WSDL fails (https://{myorg}.api.crm.dynamics.com/XRMServices/2011/Organization.svc?wsdl).  From some online searching I found that if I append =wsdl0 (https://{myorg}.api.crm.dynamics.com/XRMServices/2011/Organization.svc?wsdl=wsdl0) to the end than it does work.  That does indeed work for me in a browser. But if I do try to use the Organization URL from the code then it doesn't work because the API call appends ?wsdl to the end for me which clashes with me trying to use wsdl=wsdl0.  I couldn't find any combination that would allow me to use that wsdl reference.  Maybe that's a clue why the Discovery wsdl reference doesn't work after I authenticate.

Another possibility: do I need to do anything with the device registration?  I've recreated that LiveDeviceID.xml. It doesn't ask for a username/password or anything. Does that matter, or do I need to register that with CRM online somehow?

Any ideas on what I'm missing? 

Thanks!

Scott


Viewing all articles
Browse latest Browse all 82002

Trending Articles



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