Before starting the adventure of coding an application in Java for SharePoint Online, make sure you’re well prepared for the following points:
- Documentation is rare. No code examples exist on MSDN other than for C# or VB.NET (and some SOAP signatures). Moreover, translating MSDN’s C# examples into Java is tough, as they use language specific imports. The best info I could find was a webcast with a java coding demo for SharePoint (in French: MSDN Webcast by Stève Sfartz). The SharePoint Online Developer Guide and the MSDN documentation will be your best friends though.
- Microsoft’s WSDLs won’t generate easy to use POJOs. This is essentially because SharePoint Online’s SOAP Web Services are resource-orientated. This means you can send big and complex requests to SharePoint’s Web Services, but also that you’ll have to manipulate your objects like XML documents rather than objects. And the “XAML” structure used in the requests/responses isn’t always fully documented with examples on MSDN either.
- Consuming SharePoint Online’s WSDLs in your favorite Java IDE won’t necessarily work. I had to use the Axis 1.4 from the command line to generate my Java classes for Netbeans (the generated classes couldn’t be compiled when imported from Netbeans wizard). Your mileage may vary…
Therefore, if you have the possibility to use C# instead of Java, don’t think twice: use C#. You’ll save a lot of development and maintenance time. I wouldn’t recommend developing an application in Java if its size goes beyond the one of a small application or proof-of-concept.
The first project I would like to put forward on this blog concerns the integration of external business data with Microsoft SharePoint Online. This theme concerned a part of my Bachelor’s thesis that I did last summer which was named “Electronic Documents Management Optimization In A Consulting Firm”. I will share the parts that I found the most interesting and challenging, in my opinion.
First of all I would like to put some context on the topic that I will cover. The company I worked for was a small “deskless” RH consulting business that managed all of its information (addresses, meetings, projects, etc) through the web, on a custom built PHP-MySQL CRM (Customer Relationship Management) server. It was hosted by a local ISP on a linux server.
It soon became apparent that such a CRM wouldn’t be able to support a centralized document management system, which the company increasingly needed. Consequently, they had to find a solution available on the market.
The company finally settled for Microsoft’s cloud based solution, SharePoint Online, which is part of the Business Productivity Online Suite, to manage their documents. It turned out to be perfectly suited for such a small deskless company. It offered great functionality fora very low cost (thanks to the Software As A Service model, where you pay only for what you use), and low maintenance once set up.
Conception of a solution
One of the challenges of SharePoint Online is that there isn’t any obvious way to integrate external business data from a non-Microsoft source.
This was however a very important point in my project, because alot of the company’s documents had to be organized by client’s names. And guess what: the clients names had to be the same in the CRM’s MySQL database and a SharePoint Online’s list.
But thanks to SharePoint Online’s Web Services, it was possible to build a connector in Java that that made the link between the CRM and SharePoint.
It is important to note that the connector can’t be actioned from within SharePoint Online, as it is impossible at this time to deploy custom code on SharePoint’s cloud-based server. Therefore, clients information would need to be entirely manipulated from within the CRM (and therefore the connector), and the SharePoint clients list protected from users manual access.
Java was chosen because it could directly be deployed on the company’s rented LAMP server.
The point here is to show you that if don’t have a Microsoft infrastructure (Access database, Windows OS that can deploy C# code), but would like to integrate existent business data with a low-priced SharePoint Online solution, it is possible. I’ll use PHP and Java as examples.
How it works
The objective was to have the same names of the clients in the CRM and in a SharePoint Online’s clients list. The designed solution worked like this:
- A collaborator types in a new client’s information in an HTML form on the CRM, from his computer.
- The Apache server, which is running PHP, adds the client’s information in the local MySQL database, while sending the same info to a “Java to SharePoint connector” running on Tomcat (this is done with a PHP-Java Bridge).
- The Java connector processes the received data and encapsulates it into an XAML request that is sent SharePoint Online’s ASMX 2.0 Lists Web Service.
- The data is added in the list (which name was detailed in a properties file used by the connector). The list in SharePoint Online is the most restricted as possible for SharePoint Users: the whole point of building a connector is lost if clients information is manipulated from more than one place, for the simple reason that SharePoint Online can’t push those information outside of its walls!
- SharePoint Online sends the result back to the connector, which is then passed to PHP, which in turn displays the result to the end user.
The Java code used to build the connector and the implementation of the bridge with PHP will be described in further posts. Your comments are welcome!
Dear cyber visitor,
Thanks for stopping by! Time has come for me to contribute some of my IT projects and experiments to the almighty web!
The content will be split in multiple posts. I’ll upload relevant code and resources as well (yay!).
Here’s what I plan to post (the topics might change):
Using external business data with SharePoint Online
- Part 1: Scenario and conception of a solution
- Part 2: Java and SharePoint Online’s Web Services
- Part 3: Bridging PHP and Java
- Part 4: Testing and conclusion
Extending SharePoint Online’s functionality with jQuery
- Part 2: Coding the plugin, its loading scheme and its UI
- Part 3: Copy operations
Thank you for visiting my blog. I’ll be happy hear your feedback on those posts.
David Dudok de Wit