integrate mule esb with microsoft office 365 share point - whishworks blog

6
August 31, 2015 by Sanjeet Pandey ESB , Mule ESB , SOA No Comment Integrate Mule ESB with Microsoft Office365 SharePoint Overview MuleSoft provides the most widely used integration platform to connect any application, data service or an API, across the cloud and onpremise continuum. Microsoft Office365 SharePoint is a cloudbased Content management infrastructure that is accessible to the user programmatically via a MuleSoft ‘Microsoft Service Bus’ connector. SharePoint Online is a cloudbased 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. Prerequisites 1. Microsoft Office365 SharePoint Account 2. Microsoft Office365 SharePoint Host , User Name and Password 3. Mule Anypoint Microsoft SharePoint 2013 Connector Microsoft Office365 SharePoint Account To complete this sample, we need an MS Office365 SharePoint account. We can sign

Upload: saikuppannagari

Post on 19-Jan-2017

121 views

Category:

Business


1 download

TRANSCRIPT

August 31, 2015 by Sanjeet Pandey ESB , Mule ESB , SOA No Comment

Integrate Mule ESB with Microsoft Office­365SharePoint

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

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

 

 

 Prerequisites1. Microsoft Office­365 SharePoint Account2. Microsoft Office­365 SharePoint Host , User Name and Password3. Mule Anypoint Microsoft SharePoint 2013 Connector

Microsoft Office­365 SharePoint AccountTo complete this sample, we need an MS Office­365 SharePoint account. We can sign

up for a free trial.

 

Add and Manage Users

SharePoint Online has a full­featured framework for adding and managing useridentities and establishing granular administrative models. We should choose the firstoption for adding new users in the Users section of the Admin Overview page.

 

Mule Anypoint Microsoft SharePoint ConnectorSharePoint is a web application platform for content and document management,intranet portals, collaboration, extranets, websites, and enterprise search. MuleSharePoint connector enables integrating with SharePoint and provides followingmethods –

CRUD for DocumentsCRUD for Document LibraryCRUD 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 itsown name.Connection Pool: SharePoint connector offers automatic connectionmanagement via the use of a connection pool. This pool will act a storagemechanism 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 establishedconnection and if onedoesn’t exist, it will createone. This lookupmechanism is done in theconnection pool via the useof connection variablesdeclared as keys.

ReconnectionStrategy:ReconnectionStrategies specify on how aconnector behaves whenthe connection fails. We cancontrol the attempts by Muleto reconnect using severalcriteria –

Type of exceptionNumber and frequencyof reconnection attemptsNotifications generated

With a reconnection strategy, the behaviour of a failed connection can be controlled ina much better way by configuring it, for example, to re­attempt the connection onlyonce every 15 minutes, and to give up after 30 attempts. An automatic notification canbe sent to the IT administrator whenever this reconnection strategy goes into effect. Astrategy 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 IntegrateMicrosoft SharePointThe below Mule application is used to create folder under Microsoft Office­365SharePoint using Mule Anypoint Microsoft SharePoint connector.

 

Steps to be followed for integrating ‘Microsoft Office­365 SharePoint’ with MuleSoftApplications:

1. Install the Microsoft SharePoint Connector in Anypoint Studio (3.5 andabove)http://repository.mulesoft.org/connectors/releases/3.5

2. Create a new Anypoint Studio Project and Flow.3. Before using the Microsoft SharePoint Connector in the Mule Flows, create aglobal element for ‘Microsoft_SharePoint_2013__Online_Connection’ configurationwhich can be reused in all other flows across the Mule project – wherever theobjects are created & deleted to and from Microsoft SharePoint.

4. Configure the ‘Microsoft SharePoint’ connector by providing the followinginformation for the global element

User NamePasswordSite Url

5. Use HTTP inbound endpoint to hit the service and to crteate folder in the MicrosoftOffice­365 SharePoint.

6. Configure the Microsoft SharePoint endpoint by providing the following to createfolder in the SharePoint document library  –

Link to the ‘global Connector Configuration’Operation name

 

Running the Application­

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

1. Right­click on the application in the Package Explorer pane.2. Select Run As > Mule Application:3. Start a browser and go to http://localhost:8081/createFolder4. The success response should be returned in case of successfully creation of folderunder SharePoint document library.

Folder creation under MS SharePoint –

 

 Benefits

No point­to­point integration requiredSeamless integration running in the backgroundQuick data synchronization between Microsoft  SharePoint with an on­premise andcloud (Office­365) based applicationsFacilitate applications with Microsoft SharePoint capacities for large volume datastorageStore applications data and can be rolled back during disaster recoveryBi­directional data communication between applications and Microsoft SharePointHighly scalable, it secures a solution for backing up and archiving your critical dataSend event notifications when objects are uploaded to Microsoft SharePointAccess any amount of data, at any time, from anywhere on the web

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