6 Replies Latest reply: Nov 15, 2012 2:40 AM by Ørjan Moe RSS

    OSB client for Microsoft Dynamics CRM 2011 i.e. WCF/.NET 4.0?

    Ørjan Moe
      Hi,

      I am trying to connect OSB to Microsoft Dynamics CRM 2011 to be able to use the Organization service it provides. The goal is to have OSB expose some more specific services (CreateContact, CreateLead) for CRM based on the very flexible, loosely typed interface the Organization service provide ("create entity").

      I have search intensely for any experience with this, but have not come up with any examples on how people have managed to connect to the 2011 version of CRM. I have found examples of connection to the previous version of Dynamics CRM, and also the online version of CRM 2011, but not the on-premise version which is my scenario. The on-premise version utilizes WCF/.NET 4.0 with SPNEGO WS-Trust to authenticate to Active Directory. This policy is not supported out of the box from OSB/WebLogic, however I would assumed the should be a (easy?) workaround?

      Do I need to write Java client call-out? (Not sure there are any Java frameworks that support this either, ref. CXF (http://groovyjava-tom.blogspot.no/2012/01/cxf-and-ms-crm-2011.html) which also fails)

      Do I need to create a custom client policy with special assertions for SPNEGO?
      If so, how do I do this?

      Any feedback is appreciated. I am a bit surprised that there isn't any blog or forum out there describing this scenario, as I would assume it is not such a rare one.

      Regards
      Ørjan
        • 1. Re: OSB client for Microsoft Dynamics CRM 2011 i.e. WCF/.NET 4.0?
          soa_adf
          Hi - Did you find any solution? Everything I see is how SOA has as the server and browser as the client and not the other way around.
          • 2. Re: OSB client for Microsoft Dynamics CRM 2011 i.e. WCF/.NET 4.0?
            Damien Moore
            Hi

            Not sure if I can help but have you tried setting up SPEGNO at WLS level similar to what needs to be done for windows native authentication?
            • 3. Re: OSB client for Microsoft Dynamics CRM 2011 i.e. WCF/.NET 4.0?
              Ørjan Moe
              I have raised a SR with support and have got some feedback which points to setting up Kerberos/SPNEGO on WLS for single sign-on. Seems like quite a lot of configuring, and not sure it will work for this particular web service...
              Anyone who has any experience with this?

              I have been able to authenticate with NTLM to the REST interface (http://msdn.microsoft.com/en-us/library/gg334279.aspx) using a java client as described in How to enable NTLM authentication in OSB???
              I'm looking into creating a simple java callout from OSB to do the authentication and the basic http operations (GET, POST, PUT, DELETE). A proxy service will then act as a wrapper exposing a SOAP interface for Create-/Get-/Update-/Delete- Contact/Account/Lead etc operations, transforming these to/from REST operations which are executed by the java callout.

              Regards
              Ørjan
              • 4. Re: OSB client for Microsoft Dynamics CRM 2011 i.e. WCF/.NET 4.0?
                Damien Moore
                Have you taken a look at this blog post?

                http://biemond.blogspot.ie/2011/09/using-owsm-kerberos-policies.html

                Once kerberos/SPEGNO is created for WLS , you should then be able to apply policies for WS-TRUST which should achieve your authentication mechanism although I have not tried this for OSB, it works perfectly well for webcenter and SOA Suite without the need
                to perform java callouts or write java clients.

                Damien
                • 5. Re: OSB client for Microsoft Dynamics CRM 2011 i.e. WCF/.NET 4.0?
                  Damien Moore
                  Should point that the Kerberos/SPEGNO approach will only for client consumers that logging into the Active Directory network via a windows desktop. If this is not your use case then your approach may be more appropiate.
                  • 6. Re: OSB client for Microsoft Dynamics CRM 2011 i.e. WCF/.NET 4.0?
                    Ørjan Moe
                    Hi, thanks for the update.

                    My scenario is that the OSB will be the "client" accessing MS CRM. We want to be able to connect to CRM from OSB specifying a username when doing this. This is due to the fact that we want to expose "CRM services", e.g. CreateLead, GetLead, CreateAccount, GetAccount etc. on the bus, and the consumers of these services are not necessarily users authenticated on AD (or even on the LAN). The OSB will be the proxy between the consumers and MS CRM (or even a different CRM application in future). We would like to achieve "louse coupling".

                    The OSB is running on WebLogic on Linux.
                    Does this mean that your approach will not work then, and that using a Java callout and REST is a good idea for the time being?
                    I would really like to use the "real" IOrganization wsdl based interface from MS CRM, but have been struggling to come up with a solution for this.

                    An update on the use of the REST interface: I have created at basic Java HTTP client using HttpClient from the Apache HttpComponents (ver. 4.2) and have successfully connected to the REST interface from the OSB/WebLogic on Linux.
                    My previous Http client based on java.net only worked in my local eclipse environment on Windows, not when I deployed it to OSB/WebLogic on Linux.

                    Regards
                    Ørjan