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.

Sunday, October 11, 2009

ShareTalk Integration (SharePoint/BizTalk) – Part 3 Posting Documents to SharePoint Document Library

In Posts 1 and 2, we covered installing Windows SharePoint Services(WSS) 3.0 and installing the BizTalk – WSS Adapter web service. In this post I will walk through a simple integration scenario that will cover posting a document to a SharePoint document library.

Sending documents to a SharePoint library

  • First thing we will need to do is create a document library where we can post documents to. From the Web Application that you created in Post 1, click on the “Site Actions” tab in the top right corner and click “Create”

image

  • Click on “Document Library”

image

  • Give your document library a name and make a note as you will need the name of this library when populating the send port in BizTalk.

image

image

  • You will now need to add the BizTalk host instance user to this site so that you can write to this particular document library. To do this click on the “Site Actions” dropdown and select “Site Settings”

image

  • Click on “People and Groups”

image

  • Click on “Add Users”

image

  • Provide your Host Instance with “Contribute” permissions and restart your BizTalk Host Instance.

image

  • In the BizTalk Admin console, create a new application - I called mine “SharePointPOC”. I then created a Receive Port and Receive Location that looks for xml documents via the FILE Adapter.

image

  • Create a Send Port and specify the “Windows SharePoint Service” as the transport type.

image

  • If you provided your Web Application with a non-standard port (anything other than 80) then you will want to make this change here. You will also need to provide the name of the document library that we created in a previous step. In my sample, my document library is called “Inbound Documents”. Finally, you will need to provide the base URL to your site. In my example, this equates to http://MyServer:99/sites/BizTalk%20Repository/

image

  • You will now need to create a filter that will ensure any documents that are processed from the Receive Port, that you created, will now get sent to SharePoint.

image

  • Ensure your application is started and drop a file into the file drop folder that will match your file mask

image

  • If everything is configured correctly, you should now find a file in your document library in SharePoint

image

Check out Post 4 where I describe how to pull documents from SharePoint.

ShareTalk Integration (SharePoint/BizTalk) – Part 2 Setting up BizTalk – WSS Adapter Web Service

In Part 1 of this series I described the steps involved in installing WSS 3.0 on a BizTalk Server. The next step is to install the BizTalk – Windows SharePoint Services Adapter Web Service.

Wait a minute! I have the WSS Adapter in my list of adapters and I haven’t installed WSS 3.0 or any web services. While true, have you tried to use it?

image

If you try to use the adapter without the prerequisite WSS 3.0 or Adapter web service you will be prompted with the following warning:

Event Type: Warning
Event Source: BizTalk Server 2009
Event Category: (1)
Event ID: 5740
Date: 10/10/2009
Time: 1:55:06 PM
User: N/A
Computer: <SERVER>
Description:
The adapter "Windows SharePoint Services" raised an error message. Details "The Windows SharePoint Services adapter Web service was not found at the specified URL, "
http://localhost/BTSharePointAdapterWS/BTSharePointAdapterWS.asmx". The Windows SharePoint Services adapter Web service feature is required to be installed and configured on machine localhost. If the feature has been installed and configured, then verify that Adapter Web Service Port and SharePoint Site URL settings on the BizTalk port are correct.

This error was triggered by the Windows SharePoint Services receive location or send port with URI wss://localhost:80/abc?ViewName=.

Windows SharePoint Services adapter event ID: 12461".

  • Once you have WSS installed it is time to run through the BizTalk install. I previously had BizTalk installed on this machine, so I am simply going to “Modify” my existing installation:

image

  • I now have the ability to check the “Windows SharePoint Services Adapter Web Service” check box. The BizTalk install process will determine if WSS is installed and if so you have the ability to install this Adapter Web Service.

image

image

image

image

  • Check on the “Enable Windows SharePoint Services Adapter on this computer”. Use the drop down list to select the WSS Site where you would like the adapter to be installed. I established the “SharePoint – 99” site in Post 1 of this series so I am going to go ahead and use it. Be sure to add the user of the Host instance, that will operate this adapter, to the “SharePoint Enabled Hosts” group.

image

  • Assuming everything is aligned correctly, you should now be able to click the “Apply Configuration” button.

image

  • Next

image

  • Success

image

If you launch IIS and navigate into the WSS Site that you created in Post 1 you will find that BizTalk – WSS Adapter Web Service now installed. The BizTalk WSS Adapter will leverage this Web Service when calling the SharePoint API.

image

So what is the point of the the WSS Adapter if SharePoint exposes functionality through a Web Service. I can only speculate, but I believe part of this motivation is to abstract some of the complexity involved in calling these Web Services. It also allows you to create solutions without needing to crack open Visual Studio to consume web services and create proxies. By leveraging the Adapter + Web Service you can build some pretty powerful solutions without even creating a BizTalk Project. This allows you to turn around solutions quicker and really becomes a ‘Value Add’.

Check out Post 3 on how to post documents to a WSS document library.

Saturday, October 10, 2009

ShareTalk Integration (SharePoint/BizTalk) – Part 1 Setting up WSS 3.0

In a previous post I mentioned that I was going to dig a little deeper into building integrated solutions using SharePoint as the front end GUI and leverage BizTalk as the back end integration tier. Before I get too involved in building solutions, I figured that it would be helpful to provide a step by step ‘tutorial’ on how to set up the prerequisite components.

What will you need to build these solutions?

  • Windows Server 2003/Windows Server 2008 32bit or 64 bit
    • You can also install WSS3.0 on Vista or Win7 by using a trick (don’t do this in production scenarios)
  • IIS
  • BizTalk Server 2009 & SQL 2005/2008
  • Visual Studio 2008
  • Microsoft InfoPath(future posts)
  • Windows SharePoint Service 3.0 – download here
  • Windows SharePoint Services 3.0 requires Microsoft .NET Framework 3.0. The .NET Framework must be installed prior to installing Windows SharePoint Services 3.0.

For the purpose of this post, I am running a 32 bit system and am not connected to Active Directory so mileage may vary. If you are trying to run mixed mode – say 32 bit WSS install on 64bit system there are some special considerations. See the BizTalk installation documentation for more details.

Also, I have followed the configuration guidelines that were provided in the BizTalk install document. If you have no intentions of running BizTalk with WSS 3.0 then the following configuration may not meet your requirements.

Installing WSS 3.0 (on your BizTalk Server)

  • Launch SharePoint.exe and accept terms
  • Select an “Advanced” installation

image

  • Select - “Web Front End” as the Server Type install and click “Install Now”

image

  • After about 10 minutes you should be prompted with the following screen:

image

Ensure the configuration checkbox is clicked and click the “Close” button.

  • “Next”

image

  • “Yes”

image

  • Modify the current configuration and indicate “No, I want to create a new server farm”. This applies even if you have a single BizTalk Server deployment

image

  • Provide a Database server name and credentials.

image

  • Default values used

image

  • Default values used

image

image

  • Success!

image

  • You now have a functional WSS 3.0 install

image

At this point, the administration portal has been created. You can use this portal to create new Web Applications, or sites, that can be utilized by your users. Ideally, you would want your user’s team sites running off of a different Web Site than your admin portal. I will now walk you through creating a new Web site and document library that can be used by BizTalk, or any other user for that matter.

  • Click “Application Management”

image

  • Click on “Create or extend Web application”

image

  • Click on “Create a new Web application”

image

  • I have decided to create my Web Application in a new IIS Web site called “SharePoint – 99”. I have done this so that I don’t overwrite or break anything that may be living in my Default Web Site. I also have modified the port to be “99” which means any requests to my WSS Site will need to have “:99” in the url. If you do this then when you post or retrieve documents to/from SharePoint from BizTalk that you will need to include this port number in your Receive Location/Send Port configuration.

image

Note that “:99” makes up part of the URL. I also want to have a WSS dedicated App Pool which I have called “SharePoint – 99” so it is very clear when determining which IIS Web Site uses this App Pool.

image

  • Note that I have appended “99” onto the Database Name that will be used for storing Content. Much like if you ran multiple BizTalk Groups on a SQL Server it is much easier to clean Databases up when you can easily differentiate them.

image

  • Success!

You have now created the “shell” for this Web Application, but you still don’t have any content in this Web Application. Click on the “Create Site Collection” link. Remember to issue an “iisreset /noforce” command to complete the Web Application creation process.

image

Give your Site a Title, Description(if so desired) and create a URL. Note I have pulled the drop down list and indicated that I want this site to reside under the “sites” umbrella. This just allows sites to be organized a little better.

image

For this site, I have decided to create a “Team Site”. Team Sites are generally a place where team members can collaborate by publishing documents, but other features exist such as Team Calendars, surveys, links etc.

Also indicate users to administrate the site.

image

  • Team site has now been created.

image

  • Click on the link to verify that it was create successfully.

image

That is all for configuring WSS 3.0. Check out Part 2 of this series to configure the BizTalk – WSS Adapter Web Service. You will utilize the WSS Web Application that you just created as part of the Adapter Web Service Configuration.