Friday, March 24, 2017

Integration of Adobe Experience Manager(AEM) with Salesforce - Part1

Integration of Adobe Experience Manager(AEM) with Salesforce - Part1

Adobe Experience Manager(AEM) Salesforce cloud connector can be used to integrate to Salesforce via connected App configured in the Salesforce

The Adobe Experience Manager(AEM) Salesfore integration supports the following functionalities:
  • Lead Search
  • Contact Search
  • Export AEM user as Salesforce Lead
  • Associate an AEM user with a Salesforce "Contact" or "Lead"
The connector can be extended to support the additional functionalities.


Defining the connected App in Salesforce:

A connected app integrates an application with Salesforce using APIs
Connected apps use standard SAML and OAuth protocols to authenticate and provide tokens for use with Salesforce APIs. The required security policies can be set to control the connected Apps access.

Login to Salesforce - login.salesforce.com
Click on the user name- Setup- Click on Create then Apps
Create New connected App
Enter the name and Email address



Thursday, July 24, 2014

Cipher not initialized exception while invoking the Salesforce service through OSB

Cipher not initialized exception while invoking the Salesforce service through OSB

We are getting the "Cipher not initialized" exception wile invoking the Salesforce services through OSB.


We are able to invoke the login.salesforce.com URL successfully and able to receive the session id, also this exception was thrown only for a particular sandbox but the all other sandbox invocation is successful.

The "Cipher not initialized" exception will be thrown when there is no common Ciphers available between the client and server while negotiating the SSL communication.

We have raised a case with Salesforce regarding this and receive the response as "We recently upgraded our Cipher suites for SSL. To resolve the issue upgrade latest version of Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files- 6 for JDK1.6 on middleware."

After upgrading the Unlimited Strength Jurisdiction Policy Files in all the servers nodes we are able to invoke the service successfully.

Steps to resolve the issue

  • Download the Unlimited Strength Jurisdiction Policy Files from http://www.oracle.com/technetwork/java/javase/downloads/index.html(Under Additional Resources" section), for java 1.6 use http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
  • Unzip the downloaded zip 
  • Copy local_policy.jar and US_export_policy.jar to the $JAVA_HOME/jre/lib/security in all the OSB nodes.
  • Restarts the servers.
Now you will be able to invoke the service successfully.


Saturday, July 5, 2014

java.io.IOException: Server returned HTTP response code: 400 - While invoking the Salesforce login url from java to get the access token

java.io.IOException: Server returned HTTP response code: 400 - While invoking the Salesforce login url from java to get the access token

I was getting the below exception while invoking the Salesforce login url to get the OAuth access_token from java.

java.io.IOException: Server returned HTTP response code: 400 for URL: https://login.salesforce.com/services/oauth2/token
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at RestCaller.execute(RestCaller.java:46)
at RestCaller.main(RestCaller.java:10)

This exception will happen normally when the values of client_id, client_security, username and password are not specified correctly while invoking the login url - https://login.salesforce.com/services/oauth2/token to get the OAuth access token.

"grant_type=password&client_id=13MVG9Y6d_xxxxxxx&client_secret=8039xxxxx&username=albinsharpxxxxx&password=Albinxxxx"

In my case, I have specified all the values properly but still it was not working, it worked after resetting the password and getting the new security token - password(password+security token)


Invoking Salesforce REST based web service from Java

Invoking Salesforce REST based web service from Java

This post will explain the approach to call the Salesfore REST based webservice through java.
I have exposed a Apex class as REST service from salesforce to fetch the account details.

@RestResource(urlMapping='/AccountDetails/*')
global with sharing class AccountDetails {

    @HttpGet
    global static Account doGet() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        System.debug('Account Id:'+accountId);
        Account result = [SELECT Id, Name, Phone, Website FROM Account WHERE Id = :accountId];
        return result;
    }
}

The communication is of two steps
  •  getting the access_token 
  •  invoking the service endpoint by attaching the access_token to the request.
To obtain an access token, we will send an HTTP POST request to the authentication endpoint exposed by Salesforce - https://login.salesforce.com/services/oauth2/token  with the details client_id, client_secret, username and password.This values can be get from the configured Connected Apps from salesforce.





Saturday, April 5, 2014

Oracle Cloud Adapter for Salesforce.com - Oracle SOA Suite

Oracle Cloud Adapter for Salesforce.com - Oracle SOA Suite

Oracle introduces the Cloud Adapter for Salesforce.com as the extension of Oracle SOA Suite and this is certified only with the version 11.1.1.7.0.This will help the customers to integrate with the the Salesforce.com cloud easily.

When integrating the Salesforce.com via web service integration the main concerns are the Security management and the Session management.The web service integration requires more manual configurations, we have to connect to the Enterprise login with the authentication details to get the token values then using the token we have to do a API call to perform the operations in Salesforce.Oracle Cloud Adapter for Salesforce.com provides Intelligent Session management and security management and also provides a GUI to perform all the configurations.





Thursday, December 12, 2013

Approaches to integrate Oracle SOA Suite with SalesForce.com

Approaches to integrate Oracle SOA Suite with SalesForce.com

This post explain the different Approaches to integrate Oracle SOA Suite with SalesForce.com.



Integrate Oracle SOA With SalesForce.pdf


Tuesday, December 20, 2011

Invocation of One way webservice deployed in Oracle SOA Suite from SalesForce.com (SFDC)


Invocation of One way webservice deployed in Oracle SOA Suite from SalesForce.com (SFDC):

Whenever SFDC tries to consume the WSDL which has one-way operation (operation with only input) it fails with the following error –“Can’t find the output in the port type execute_ptt”.



As a solution we can specify a dummy output of type string, so that SFDC is able to consume the WSDL and create the classes related to the elements of the WSDL.



Invocation of webservices deployed in Oracle SOA Suite from SalesForce.com (SFDC)


Invocation of webservices deployed in Oracle SOA Suite from SalesForce.com (SFDC):

Whenever SFDC tries to consume the WSDL which has imports (another XSD or WSDL) it fails with the error - “The import is not recognized



How to Fix

As a solution we have to prepare a linear WSDL (wsdl without imports –coping the contents of the imported XSD/WSDL to the parent WSDL), so that SFDC is able to consume the WSDL and create the classes related to the elements of the WSDL.