SharePoint Web Services: 3 things to consider before coding in Java
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.