I am working with SharePoint and Project Server CSOM (Client-Server Object Model) for both SharePoint and Project Server for some months now. This API is a replacement for the traditional XML/WCF web services exposed by both products for years now. The APIs are rational, consistent, and do not require the usual rigging for a web service (endpoint configuration, proxies, and the various other scaffolding required to consume the web services). These are all great improvements.
Note that the CSOM for both SharePoint and Project Server, to date, implement a subset of the functionality of the traditional web services—and performance work is ongoing in the product groups. Like anything new out of these SDKs, it takes investment to reach parity in feature completeness and performance. That being said, get on it Microsoft!
I found CSOM is repetitive and while vastly less costly in terms of key strokes, it is nonetheless bulky and disjointed. Also, because I tend to use both the SharePoint CSOM and the Project Server CSOM in the same project, I decided I was ready to put something together like mpFx. The term “mpFx” means “Microsoft Project Effects” or, what I prefer “Microsoft Project Feature eXtensions”, which is more descriptive.
I set out to design a single API for accessing SharePoint and Project Server through a single library, with the ability to request services from Azure such as Cloud Storage, Cloud Services, DocumentDB, Managed Cache Services, and others through a “late-bound factory”, so as not to burden the basic API. In addition to CSOM, the library will expose oData from both SharePoint and Project Server.
This new API is call OSoFx, pronounced OH-SO-FX—Office Server Online Feature eXtensions. OSoAFx maybe, as in Office Server Online and Azure Feature eXtensions—pronounced OH-SO-A-FX?
A combined API allows for myriad benefits, but in today’s post I want to demonstrate the differences in syntax and the brevity of the API.
The following operations are performed by both straight CSOM and OSoFx (both servers are Office Online):
1.) Setup credentials
2.) Create a connection to Project Server
3.) Create a connection to SharePoint Server
4.) Present the version numbers for both servers
5.) List the projects
6.) List the sites
7.) Show how long it took to do this
Here is a side-by-side, the first straight CSOM and the second OSoFx
There is a bit of work behind the scenes in OSoFx to make this work, but the fruits of labor can be used by others. More on this later!