A while back I described the problems I had checking files out of SharePoint 2010 using CMIS REST bindings (more specifically, using the excellent Apache Chemistry OpenCMIS client API for CMIS). At the time, it seemed odd to me Microsoft would release a CMIS stack missing this critical feature.
Since then, I learned the SP2010 CMIS stack’s REST bindings do provide a way to check files out; so the feature isn’t completely broken after all. However, SP2010’s approach doesn’t seem compliant with the CMIS standard. So, although it works and it is RESTful, it will never be supported by general-purpose CMIS tools such as OpenCMIS.
Below is a sample message sent by OpenCMIS to check out a document using the REST bindings. This message is CMIS-compliant, and does not work with SP2010:
<?xml version=’1.0? encoding=’UTF-8??> <atom:entry xmlns:atom=’https://www.w3.org/2005/Atom’ xmlns:cmis=’https://docs.oasis-open.org/ns/cmis/core/200908/’ xmlns:cmisra=’https://docs.oasis-open.org/ns/cmis/restatom/200908/’> <atom:id>urn:uuid:00000000-0000-0000-0000-00000000000</atom:id> <atom:title></atom:title> <atom:updated>2011-05-03T15:23:45Z</atom:updated> <cmisra:object xmlns:ns3=’https://docs.oasis-open.org/ns/cmis/messaging/200908/’> <cmis:properties> <cmis:propertyId propertyDefinitionId=’cmis:objectId’> <cmis:value>1-3584</cmis:value> </cmis:propertyId> </cmis:properties> </cmisra:object> </atom:entry>
Below is the message that should be sent to SP2010 to successfully check out a document. This message is not CMIS-compliant (as far as I can tell, anyway), and does work with SP2010:
<?xml version=’1.0? encoding=’UTF-8??> <atom:entry xmlns:atom=’https://www.w3.org/2005/Atom’ xmlns:cmis=’https://docs.oasis-open.org/ns/cmis/core/200908/’ xmlns:cmisra=’https://docs.oasis-open.org/ns/cmis/restatom/200908/’> <atom:id>urn:uuid:00000000-0000-0000-0000-00000000000</atom:id> <atom:title></atom:title> <atom:updated>2011-05-03T15:23:45Z</atom:updated> <cmisra:object xmlns:ns3=’https://docs.oasis-open.org/ns/cmis/messaging/200908/’> <cmis:objectId>1-3584</cmis:objectId> </cmisra:object> </atom:entry>
The OpenCMIS request (shown first) includes a property list, with the CMIS object ID as the only property. The SP2010 request (shown second) does not include a property list, just a [cci lang=”xml” escaped=”true”]<cmis:objectId>[/cci] tag.
That [cci lang=”xml” escaped=”true”]<cmis:objectId>[/cci] tag is what makes the SP2010 request non-compliant. The CMIS Core XML Schema defines no such tag; “cmis:objectId” appears only as an enum value for a property name (as shown in the OpenCMIS request).
Suppose you really wanted to use the REST bindings, what should you do? Well, you have to write a wrapper around OpenCMIS (or your other client CMIS stack of choice). The file checkout code in your wrapper bypasses your CMIS client stack, and issues a message as shown above, using whichever HTTP client software you are comfortable with. HTTP client software is pretty easy to work with, but don’t forget to parse the response and deal with the many different error codes that might be returned!
In reality this seems like too much work, especially since SP2010’s WSDL bindings seem to work just fine. So my advice is unchanged: Avoid the CMIS REST bindings if you plan to support SharePoint 2010 (or think you may support it in the future). Stick with the WSDL bindings.
I believe this internet site has very wonderful written written content content .