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.

Saturday, October 3, 2009

BizTalk 2009 WSS Adapter + Connecting to non-standard ports

When hosting Web Applications in IIS(and other web servers) you have the option to access that web site using a different port than the default (80). I had previously set up BAM and had some other applications running off of the "Default Site (80)" so I didn't want to host Windows SharePoint Services (WSS) on that port. Instead I opted for port 99 when going through the WSS configuration.

When you configure the BizTalk - SharePoint Adapter Web Service you have the option of specifying which site you want to install it in. If you want it to work, you select the site where your have installed WSS.

Upon creating a simple Send Port Subscription, I attempted to push a document to WSS. I was prompted with a warning in the BizTalk Event Viewer:


Event Type: Warning
Event Source: BizTalk Server 2009
Event Category: (1)Event ID: 5743
Date: 10/3/2009
Time: 8:48:50 AM
User: N/A
Computer: MyServer

Description:
The adapter failed to transmit message going to send port "SendToSharePointLibrary" with URL "wss://MyServer:99/sites/BizTalkDocs/Surveys". It will be retransmitted after the retry interval specified for this Send Port. Details:"The Windows SharePoint Services adapter Web service was not found at the specified URL, "
http://MyServer/BTSharePointAdapterWS/BTSharePointAdapterWS.asmx". The Windows SharePoint Services adapter Web service feature is required to be installed and configured on machine MyServer. 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://MyServer:99/sites/BizTalkDocs/Surveys.
Windows SharePoint Services adapter event ID: 12461".

I copied the URL from BizTalk admin, replaced wss:// with http:// and placed it into a browser. The Document Library appeared so I figured it had to be related with the adapter. My inital thought was "Don't tell me the Adapter can't work when you are hosting WSS on a port other than 80". Upon some further digging this wasn't the case. I overlooked the "Adapter Web Service Port" configuration which by default is 80 even though I specify ":99" in the SharePoint Site URL. Once I made this correction, I was able to successfully post documents to SharePoint.