Ever since I’ve been developing modules for Microsoft CRM I’ve tried to use proper abstraction and call the web services to “wrapped classes” and work with the returned data as objects and collections rather than the raw XML.
So far I’ve been quite successful and for each project I’ve brought across these classes, added to them and extended them when I was working on custom fields.
The failing of my classes is that each time I instantiate them, I’ve needed to pass server host name of the CRM web service and a username, password and domain with which the class uses to authenticate against the web service.
Today I’ve figured out the security portion of CRM and more specifically how to get the logged in users ID. I’ve been working on the problem for a couple of weeks and suddenly it all just clicked.
This means that besides being able to save the user’s details to custom records that I’ve developed, I can let my wrapper classes use the cache’s user details and all I need to supply is the host name.
The catch that kept me from understanding the security, was that I was developing on my own machine which can not (I don’t understand why) have Digest Authentication, and you need to be running in the CRM application pool. I loaded a whole bunch of test pages and applications on the live CRM server and everything just worked beautifully.
Now I’m stuck with the problem of being unable to develop on my machine as I’m using the new security wrapper class in my project which, as stated above, needs to run in CRM’s application pool.
I’ve been breaking all the rules of development and testing by uploading my half finished projects to the live server but as I’ve crashed the server twice today this has to stop.
The problem is, and as I understand it’s the same with Sharepoint, is that CRM is too resource heavy to have as a virtual machine on my laptop and my company can’t justify giving me my own little pc to use as a test server.
Anyways, if you’re reading this and you’re interested in my wrapper classes or are looking for advice on Microsoft CRM 1.2, email me and I’d be happy to help.