SharePoint adapter: readonly access to doclibs RRS feed

  • Question

  • Hi,

    I have the following use case:

    • A SharePoint Online document library where documents are published;
    • A BizTalk Receive location I want to use to retrieve documents from this doc lib
    • A BizTalk Send port to send the received documents to a File share.


    • The BizTalk account user is not allowed to remove documents from the source document library
    • I don't want to remove the documents from the doc lib, I just want to synchronize them with the file share, and if possible only when needed.

    With BizTalk 2016, it sounds like it is not possible, am I right?

    Thursday, June 8, 2017 9:42 AM

All replies

  • Hi David

    The problem with 'read-only' would have been that BizTalk would have fetched the same set of files endlessly.

    You may want to write your own adapter (that uses the SharePoint CSOM) for this requirement.

    Another option is to introduce a custom column in your library say Status. All new documents would be tagged with Status = New. Now, create a View, say View1 based on this column that shows documents with Status = New.

    The BizTalk Receive Location would read from the above View and send to File Share(note the file is deleted from SP at this point). Another SendPort (same subscription as the FILE SendPort) would write back the document to a new SharePoint View, View2. This View would be based on the filter Status = Read, for example. This SendPort would set this custom column value while writing back the document - you can do this on the adapter config. By the way, the default View in SharePoint would be View2 (that is documents that have been read and sent back by BizTalk).

    Thanks Arindam

    Thursday, June 8, 2017 10:38 AM
  • Arindam,

    The FTP adapter provided by BizTalk is currently supporting a readonly mode and it works fine.

    Each time the adapter check the content of the FTP folder, it checks if the file was updated (date/time). If not, it consider that the file was not updated.

    There is also a mode to force the re-download of a file even if is was not updated, one time per day for example.

    I think that the BizTalk SharePoint adapter should be implemented this way too.

    Thursday, June 8, 2017 10:47 AM
  • David

    You are right, the FTP adapter was enhanced to allow this feature.

    Thanks Arindam

    Thursday, June 8, 2017 1:16 PM

  • I think that the BizTalk SharePoint adapter should be implemented this way too.

    Unfortunately the SharePoint adapter is NOT implemented that way.

    You need to write your own functionality using SharePoint 2010 Client Object Model

    It is not too difficult. Just create a SharePoint context and execute what you need against it. You will need a basic understanding of CAML Query Schema.

    This is how I create the context object:

            public ClientContext GetSharePointClientContext(string anUri, string aUsername, string aPassword, string aDomain)
                // Create network credentials
                NetworkCredential theNetworkCredential = new NetworkCredential(aUsername, aPassword);
                theNetworkCredential.Domain = aDomain;
                // Create context and apply credentials
                ClientContext theClientContext = new Microsoft.SharePoint.Client.ClientContext(anUri);
                theClientContext.Credentials = theNetworkCredential;
                //return context to client
                return theClientContext;

    The SCOM call is very straight forward. Let me know if you need me to write it here as well.

    Another option is using SharePoint REST Web Services

    My Technet Articles

    If you like this or another reply, vote it up!
    If you think this or another reply answers the original question, mark it or propose it as an answer.

    Mauricio Feijo

    Thursday, June 8, 2017 1:35 PM