CRM 2011: Windows 8 app query with SDK RRS feed

  • Question

  • I've seen a couple of examples, and an 'official' example of a windows 8 app that can query CRM data, but they seem to not work with On-Premise CRM that uses AD authentication.

    I am researching a windows 8 app that will have a screen that can query CRM incident entity and show the current backlog of OPEN cases.  Seems that you can't use the CRM SDK because it needs .NET framework.  I also need to embed the login and password into the app because it has to run on a PC that does not authenticate to the domain.

    Any good step by step walkthroughs that use on-premise CRM where I can embed the user and pw?

    Wednesday, December 5, 2012 12:53 AM


All replies

  • I'm not aware of any step by step walkthroughs but I have been involved with a couple of Windows 8 apps integrating with Dynamics CRM 2011. The easiest solution by far is to develop a proxy service to be your interface into CRM.

    My suggestion would be to go that route if possible as it will probably be the quickest. You would make a .NET web service which would use the CRM SDK to access CRM (store the user account in the web.config or something similar) and then return the results to your app formatted however you'd like (probably JSON).

    Wednesday, December 5, 2012 5:05 AM
  • Chris,

    The only solution is what got.dibbs porpose, create a proxy. Microsoft.sdk.proxy.dll is not compatible with Windows Store apps. If you are working on OnPremise, you can create a new site (with public access) in the same IIS of CRM and publish a web service that calls to your CRM with some credentials (that you can store in web.config or XML file...). Yo can then call this web service from your Win8 app if you have public access from internet to that service. But this is not a secured environment . Another solution is to make some pure SOAP calls to CRM to authenticate through IFD. That means that you have to configure IFD authentication on your CRM and then, call the CRM data directly from your Win8 app using IFD credentials sotred in your app (yo can get credentials from the user o store ones on the code. What you have to take care is if the users that use the app are going to be users of CRM (company internal employees) or are public in general in orther to get the correct license of CRM... 

    Anyway, you have to think that Win8 app can be published in Windows Store, that means that is available for all the world or you can create Win8 app for your internal use. I do not know what are you needs but, maybe you have to think that, if you publish you app on Windows Store, you have to allow tha acces to your CRM by Internet then you have to configure IFD authentication...


    Albert Porra

    Wednesday, December 5, 2012 8:35 AM
  • Thanks, so I'll have to go the 'proxy' route.  This app would be for internal use only, and only exposed inside my network, so that shouldn't be a problem.

    I've done LOTS of C# SDK programming in web, console, and Plugins, but never done a web service. 

    How about a walkthrough on how to create that proxy webservice??

    Wednesday, December 5, 2012 1:54 PM
  • Here's a pretty good beginner's tutorial on ASP.NET Web API (uses .NET 4.5): http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api

    ...and here's an example of connecting to CRM 2011 using the SDK (in the context of a console application, but the example should be fairly easily ported to a web service): http://msdn.microsoft.com/en-us/library/gg695803.aspx

    • Marked as answer by ChrisH5491 Thursday, December 6, 2012 1:37 PM
    Wednesday, December 5, 2012 2:53 PM
  • You can create an ASMX web service or a WCF (.svc). If you want to do the most easy, try to create an ASMX web service (you'll find a lot of samples on how to create an ASMX in the web, like http://www.codeproject.com/Articles/863/Your-first-C-Web-Servic). What you have to do is, create the ASMX web service in another site in the same IIS tha CRM (or you can use ISV folder, although it is only suported in CRM 2011 for backward compatibility...). In your ASMX web service, make a conection to CRM, with the correct credentials (Windows Authentication), using Microsoft.SDK.proxy.dll (you'll find samples on CRM 2011 SDK hekp). Then, from your Win8 application call to the ASMX method you created. Here you can find a sample of how to do that with ASMX web service and also with REST, WCF... http://www.silverlightshow.net/items/Connecting-Windows-8-applications-with-services-Part-1-Using-services-to-get-data-in-our-Windows-8-applications.aspx. If you need more information don't hesitate to contact me. Hope this help. 

    Albert Porra

    • Marked as answer by ChrisH5491 Thursday, December 6, 2012 1:37 PM
    Wednesday, December 5, 2012 2:53 PM
  • Thanks for all the help, i'll give this a try!
    Thursday, December 6, 2012 1:37 PM
  • Hi ,

     i am also trying to do as you , might you get sucess if yes provide me also some guide lines...

    Friday, February 22, 2013 5:26 AM