Showing posts with label On-demand integration. Show all posts
Showing posts with label On-demand integration. Show all posts

Friday, 25 March 2016

Configure Salesforce for On demand Integration Using Dell Boomi


In this post I will give you example of invoking Boomi process using Apex class.

Invoke Boomi Atom

You require an End point URL to invoke your Boomi atom. Boomi atom could be a cloud atom or an on premises atom (locally deployed atom). Below example will explain how to connect with on premises atom.

Login your Boomi environment and click on "Atom Management".Navigate to "Shared Web Server Setting" and copy "Base URL" of your on premises atom along with port.


Salesforce Remote Site Setting

When ever you access any external site from Salesforce you need to add that in remote site setting. This is a security layer that force.com platform will check.
Enter base URL in remote site setting in your salesforce organization. 

Apex Class

Below example demonstrate that how we can pass some parameter to Dell Boomi interface in the form of an XML.

In my previous post we created "End point URL". 

Now we will use our end point url in apex class and call our Boomi process simply by writing below code.

Note: This is a generic XML structure.XML structure may differ on the bases of response profile you created in Boomi.

 public static HttpResponse getInfoBoomi()
    {
        // Get the Endpoint URL from custom label      
        String EndPointUrl = Endpoint URL;
        Httprequest request = new Httprequest();
        request.setmethod('POST');
        request.setTimeout(120000);

        request.setEndpoint(EndPointUrl);
        //set the request string for Boomi service connector containing Invoice No which will than pass to SAP to get the Invoice Base64 code
        string strInput = '<?xml version="1.0" encoding="UTF-8"?>' +
            '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
            '   <soapenv:Body> <setOutput xmlns="https://secure.logmeinrescue.com/API/API.asmx"> 
            '      <notifications xmlns="http://soap.sforce.com/2005/09/outbound">' +
            '         <Notification> ' +
            '               <InvoceId>' + ApexPages.currentPage().getParameters().get(ID) + '</InvoceId>' +
            '         </Notification>' +
            '      </notifications>' +
            '   </soapenv:Body>' +
            '</soapenv:Envelope>';

        //replace all & with &amp; to avoid xml encoding issue                      

        strInput = strInput.replaceAll('&', '&amp;');
        request.setBody(strInput);
        Http httprequest = new Http();
        string responseMessage;
        HttpResponse res;
        //send http request to boomi process
        res = httprequest.send(request);
        return res;


    }

By calling above mention function "getInfoBoomi" will provide you http response coming from your Boomi process.You can use built in function getbody to extract your data from response file.

HttpResponse res = getInfoBoomi();
 sData = res.getbody();

This way you can invoke your Boomi process from Salesforce. Hope this helps you !




Tuesday, 9 February 2016

Configure Boomi On demand Integration Connector

The following post will show you how to configure web service connector which is used to establish an on-demand integration between Salesforce and SAP using Boomi as a middle-ware tool.

Boomi Web Service Connector:

On-demand integration use "Web Service Server" Connector. It does not count against boomi connection license. It is always use to listen request from "Source" system.
  •  Login your Boomi account.
  •  Create Component--> Process --> Write your Process Name--> Save
  •  Now configure your connector.
  •  Connector = Web Service Server
  • Action = Listen
 Create a new operation
  • Operation Type = Get
  • Object = Object used for Integration
  • Input Type = Single XML Object
  • Request Profile = Create profile
  • Output Type = Single XML Object
  • Response Profile = Create profile
In order to make connection between your Boomi account and Salesforce environment. We have to configure “Shared web server settings” in Boomi.
  1. Click on “Atom Management”.
  2. Select your Atom on which you have to configure your “Shared web server setting”.
  3. Click on “Shared web server setting” a popup box will appear. Click on “Basic” tab. You have to enable port 9090 and get the base URL of your server.
  4. Now click on “Authentication” tab and check your settings.
    1. None mean only “Boomi Account ID” to make connection
    2. Basic means “Boomi Account ID” and “Security Token” both are required to make connection.
  5. Now click on “User Management” tab. Click on “Generate” button to get security token for your user account copy this security token.
  6. Now click on “Setup” navigate to “Account Information” tab and copy “Account Id”.
  7. In order to create a complete connection URL we have to follow below syntax:

    URL: <Server Base URL><Port><Operation URL>;boomi_auth=<AccountID>:<Security Token>
Note:
  • <AccountID>:<Security Token> will be base64 encode.
  • Sometime Connection URL give authentication error due to firewall security on atom server for that specific case you have to white-list salesforce public IPs on atom server and get a specific IP of your atom server which will be replace your “Base URL” in your connection URL.