2 Replies Latest reply: Jul 12, 2012 12:30 AM by 913963 RSS

    Integrating CRM On Demand /JDEE

    913963
      Hello Experts,

      We have a requirement of integrating CRM On Demand and JDEE with SOA Suite as an middle ware.

      For initial development phase we have attempt to log in to CRM OD and able to create a Session ID and log out using JAVA code available @ http://www.webbasedcrmsoftware.com.au/crm-on-demand-tutorials/65-java-access-to-crm-on-demand

      When we run the same log in java code from the SOA BPEL @ http://www.oracle.com/technetwork/topics/ofm-siebel-blog-postings-092216.html

      String sessionString = "FAIL";
      String wsLocation = "https://yourinstance.crmondemand.com/Services/Integration";
      String headerName;
      try
      {
      // create an HTTPS connection to the OnDemand webservices
      URL wsURL = new URL(wsLocation + "?command=login");
      HttpURLConnection wsConnection = (HttpURLConnection)wsURL.openConnection();
      // disable caching
      wsConnection.setUseCaches(false);
      // set some http headers to indicate the username and password we are using to logon
      wsConnection.setRequestProperty("UserName", "myusername");
      wsConnection.setRequestProperty("Password", "myencryptedpassword");
      wsConnection.setRequestMethod("GET");
      // see if we got a successful response
      if (wsConnection.getResponseCode() == HttpURLConnection.HTTP_OK)
      {
      // get the session id from the cookie setting
      for (int i=0; ; i++)
      {
      headerName = wsConnection.getHeaderFieldKey(i);
      if (headerName != null && headerName.equals("Set-Cookie"))
      {
      // found the Set-Cookie header (code assumes only one cookie is being set)
      sessionString = wsConnection.getHeaderField(i);
      break;
      }
      }
      String formattedID = sessionString.substring(sessionString.indexOf("=")+1,sessionString.indexOf(";"));
      setVariableData("SessionID",formattedID);
      //System.out.println("Session ID: " + sessionString);
      }
      }
      catch (Exception e)
      {
      System.out.println("Logon Exception generated :: " + e);
      }

      we are not able to get session ID :(

      Are we missing some thing :( like importing CRM-OD certificate to Weblogic Server?

      Please some one guide me