SharePoint Client API vs SharePoint Server API

當咱們在進行SharePoint相關的定製開發的時候,每每面臨着是選擇SharePoint Client API(Client Object model)仍是SharePoint Server API(Server Object Model)來訪問和操做SharePoint元素,例如SharePoint List/SharePoint Document。這裏主要給你們介紹一下這兩種API分別適合在什麼時候使用。web

若是你當前要訪問SharePoint的服務沒有部署安裝到SharePoint Farm所在的機器上,那麼咱們必須選擇SharePoint Client API(Client Object model)來訪問SharePoint相關元素。若是你當前要訪問SharePoint的服務部署到了SharePoint Farm所在的機器上,那麼咱們優先選擇SharePoint Server API(Server Object model)來訪問SharePoint相關元素。Client Object model與Server Object model類似,只有少部分不一樣,咱們不能經過Client Object model訪問WebApplication和Farm objects,當SharePoint OOTB的Client Object model不能實現咱們的需求的時候,咱們能夠經過WCF或者Rest協議編寫咱們本身的web service,並以web service的形式暴露給外部訪問。開發

以上便爲你們介紹了在何時適合使用Client Object Model,在何時適合使用Server Object Model,但願對你們有所幫助。部署

相關文章
相關標籤/搜索