Monday, October 12, 2009

ShareTalk Integration (SharePoint/BizTalk) – Part 4 Retrieving Documents from a SharePoint Document Library

In Post 3 I discussed how we can push documents to Windows SharePoint Services (WSS) by setting up a Send Port subscription in the BizTalk Administration console.  I am now going to reverse that scenario and have create another Send Port subscription with the difference being that the Receive Port that we will be filtering will contain a Receive Location that will poll a SharePoint Document library.

  • In my “BizTalk Repository” Web Application, I am going to create a new document library called “Outbound Documents”.  From the “BizTalk Repository” Home, click on “Site Actions” - “Create.

image

  • Click on “Document Library”

image

  • Provide the document library with a name and some additional comments.

image

  • You should now have a document library called “Outbound Documents” created

image

  • In part 3, we provided the BizTalk Host Instance user with “Contribute” access.  Those permissions were applied at the Site level so as long as you followed that step, you should not need to provide any additional permissions for this scenario.

 

  • In BizTalk Admin, create a new Receive Port and Receive Location that will use the “Windows SharePoint Service”

image

  • If you are using a non-standard Port (anything other than 80), be sure to specify it in the “Adapter Web Service Port Property”.  Also ensure to provide the base URL for your Site: http://MyServer:99/sites/BizTalk%20Repository/ and the name of the Document Library which in this case is “Outbound Documents”.
  • Notice that this adapter is a polling adapter and the default value is 60 seconds which can obviously be changed to meet your requirements.  If you have a multi-node BizTalk farm, I would expect that because this adapter uses polling that there is a risk of duplicated messages being retrieved like the POP3 or FTP adapters.  This is something that I plan on verifying in the near future.

image

  • Create a Send Port and configure it to send documents to the file drop that we established in Post 3.

image

  • Provide a Filter for this Send Port that uses the SharePoint Receive port.

image

  • Upload a document to the “Outbound Documents” Document library.

image

  • Now sit back and wait for the document to be retrieved from SharePoint and written to the location specified in your Send Port

image

image

  • If you navigate to your Document library you will notice that this document has been removed.

image

 

Series Recap

At this point we have installed and configured WSS 3.0, installed and configured the Windows SharePoint Adapter Web Service, posted documents to SharePoint and retrieved documents from SharePoint.  We are really just starting to scratch the surface with “ShareTalk” integration.  There is some seamless integration with InfoPath that we can exploit as well as taking advantage of WSS Workflow to create some interesting Approval/Rejection scenarios.  So stay tuned, I plan on further exploring these areas and have some other interesting ideas that I going to attempt and will publish my results.

8 comments:

mahesh said...

Hi Kent

I am a newbe to the biztalk world and i followed all your posts to send documents to sharepoint and retrive from sharepoint.

i was not sucessful with sending and retriveing from sharepoint and struck with the below error

The adapter "Windows SharePoint Services" raised an error message. Details "Client found response content type of '', but expected 'text/xml'.
The request failed with an empty response.".

any help is appericated!

Kent Weare said...

Hi Mahive

Do you have a more specific error? Can you browse to the adapter web service page? Something doesn't seem configured properly on the share point side of things. Also make sure your host instance user has contribute access on the library you trying to interact with.

Kent

mahesh said...

Kent,

I figured out the problem and the only work i needed to do was i need to add user name in the Sharepoint Enabled hosts group and then is started working fine.

the error message was not clear and was misleading me about content type in sharepoint.

Thanks for your response!

Kent Weare said...

Ok..that makes sense.

Unknown said...

Hi,
I will like to post documents from Biztalk to Sharepoint Online(Office 365). So do I select "windows sharepoint services" at the send port too?

Thanks.

Kent Weare said...

sb,

if you have BizTalk 2013 then you can use the SharePoint adapter to communicate with office365

Unknown said...

Hi Kent,
I am using Biztalk 2010. Is there another way to post the documents?

Thanks!

Kent Weare said...

you are likely looking at custom .net