Skip to main content

Integrate Mule ESB with Microsoft Office-365 SharePoint

Overview

MuleSoft provides the most widely used integration platform to connect any application, data service or an API, across the cloud and on-premise continuum. Microsoft Office-365 SharePoint is a cloud-based Content management infrastructure that is accessible to the user programmatically via a MuleSoft ‘Microsoft Service Bus’ connector. SharePoint Online is a cloud-based service that helps organisations share and collaborate with colleagues, partners, and customers. With SharePoint Online, we can access internal sites, documents, and other information from anywhere—at the office, at home, or from a mobile device. The Microsoft SharePoint Mule connector allows developers to access any amount of data, at any time and from anywhere on the web. With connectivity to the Microsoft SharePoint API, users can interface SharePoint to perform CRUD operations on documents and use data with other SharePoint services.  Applications can also be built for which internet storage is required - all from within MuleSoft Anypoint Platform.

Instant access to the Microsoft SharePoint API enables businesses to create seamless integration between SharePoint and other databases, CMS applications such as Drupal, and CRM applications such as Salesforce.

Integrate Mule ESB with Microsoft Office-365 SharePoint

Prerequisites

  • Microsoft Office-365 SharePoint Account
  • Microsoft Office-365 SharePoint Host , User Name and Password
  • Mule Anypoint Microsoft SharePoint 2013 Connector

Microsoft Office-365 SharePoint Account

To complete this sample, we need an MS Office-365 SharePoint account. We can sign up for a free trial.

Integrate Mule ESB with Microsoft Office-365 SharePoint

Add and Manage Users

SharePoint Online has a full-featured framework for adding and managing user identities and establishing granular administrative models. We should choose the first option for adding new users in the Users section of the Admin Overview page.

Integrate Mule ESB with Microsoft Office-365 SharePoint

Mule Anypoint Microsoft SharePoint Connector

SharePoint is a web application platform for content and document management, intranet portals, collaboration, extranets, websites, and enterprise search. Mule SharePoint connector enables integrating with SharePoint and provides following methods:

  • CRUD for Documents
  • CRUD for Document Library
  • CRUD for Users

Configure Mule Anypoint Microsoft SharePoint connector with the following settings:

  • Configuration: (MS SharePoint connector configured using the config element) This element must be placed out of flow and at the root of the Mule application. We can create as many configurations deemed necessary as long as each carries its own name.
  • Connection Pool: SharePoint connector offers automatic connection management via the use of a connection pool. This pool will act a storage mechanism for all the connections that are in-use by the user of this connector.

Prior to the execution of a processor, the connector will attempt to lookup for an already established connection and if one doesn't exist, it will create one. This lookup mechanism is done in the connection pool via the use of connection variables declared as keys.

Integrate Mule ESB with Microsoft Office-365 SharePoint

Reconnection Strategy: Reconnection Strategies specify on how a connector behaves when the connection fails. We can control the attempts by Mule to reconnect using several criteria:

  • Type of exception
  • Number and frequency of reconnection attempts
  • Notifications generated

With a reconnection strategy, the behaviour of a failed connection can be controlled in a much better way by configuring it, for example, to re-attempt the connection only once every 15 minutes, and to give up after 30 attempts. An automatic notification can be sent to the IT administrator whenever this reconnection strategy goes into effect. A strategy can also be defined which attempts to reconnect only during business hours. Such a setting can prove useful if the server is frequently shut down for maintenance.

Mule ESB – The best way to Integrate Microsoft SharePoint

The below Mule application is used to create folder under Microsoft Office-365 SharePoint using Mule Anypoint Microsoft SharePoint connector.

Integrate Mule ESB with Microsoft Office-365 SharePoint

 Steps to be followed for integrating 'Microsoft Office-365 SharePoint' with MuleSoft Applications:

  • Install the Microsoft SharePoint Connector in Anypoint Studio (3.5 and above) http://repository.mulesoft.org/connectors/releases/3.5
  • Create a new Anypoint Studio Project and Flow.
  • Before using the Microsoft SharePoint Connector in the Mule Flows, create a global element for ‘Microsoft_SharePoint_2013__Online_Connection’ configuration which can be reused in all other flows across the Mule project - wherever the objects are created & deleted to and from Microsoft SharePoint.
  • Configure the ‘Microsoft SharePoint’ connector by providing the following information for the global element: 
    • User Name
    • Password
    • Site Url
  • Use HTTP inbound endpoint to hit the service and to crteate folder in the Microsoft Office-365 SharePoint.
  • Configure the Microsoft SharePoint endpoint by providing the following to create folder in the SharePoint document library:
    • Link to the ‘global Connector Configuration’
    • Operation name
Integrate Mule ESB with Microsoft Office-365 SharePoint

Running the Application

We are now ready to run the project! First, let us  test run the application from Studio:

  • Right-click on the application in the Package Explorer pane.
  • Select Run As > Mule Application:
  • Start a browser and go to http://localhost:8081/createFolder
  • The success response should be returned in case of successfully creation of folder under SharePoint document library.

Folder creation under MS SharePoint

Integrate Mule ESB with Microsoft Office-365 SharePoint

Benefits

  • No point-to-point integration required
  • Seamless integration running in the background
  • Quick data synchronization between Microsoft  SharePoint with an on-premise and cloud (Office-365) based applications
  • Facilitate applications with Microsoft SharePoint capacities for large volume data storage
  • Store applications data and can be rolled back during disaster recovery
  • Bi-directional data communication between applications and Microsoft SharePoint
  • Highly scalable, it secures a solution for backing up and archiving your critical data
  • Send event notifications when objects are uploaded to Microsoft SharePoint
  • Access any amount of data, at any time, from anywhere on the web

Author: Mr. Sanjeet Pandey is a Masters of Computer Application (MCA) graduate having 5+ years of experience as a Technical Specialist with Coforge. He has varied experience in ESB’s like Mule, JCaps.  Sanjeet loves dreaming up new ideas, movies & music, photography & travelling and developing web projects. To know more about Sanjeet log on to www.sanjeetpandey.com

If you would like to find out more about how APIs could help you make the most out of your current infrastructure while enabling you to open your digital horizons, do give us a call at +44 (0)203 475 7980 or email us at Salesforce@coforge.com

Other useful links:

Coforge Systems Integration

API Recipes with MuleSoft Anypoint Platform

Case studies 

Let’s engage