How to Use BizTalk 2006 with Windows SharePoint Services 3.0
Published: 06 Jun 2007
This article will walk you through the configurations necessary to access SharePoint information and to use BizTalk 2006 to allow internal and external entities access to your repository.
by Arnulfo Wing
Average Rating: 
Views (Total / Last 10 Days): 41017/ 117


Microsoft provides adapters that allow you communicate to almost any data repository available.  Windows SharePoint Services is a free add-on to Windows Server. This new version has a lot more extensibility than the previous version. Microsoft has put a lot of effort into providing more functionality back into the hand of the developers. For instance, Windows SharePoint Services (WSS) 3.0 has 30+ namespaces that you can reference on your code, versus WSS 2.0 which only had less than 15 namespaces. SharePoint and BizTalk offer a tremendous combination of flexibility for your enterprise.

NOTE: In this article we are assuming that the environment is already setup according to the single server installation instructions guidelines from Microsoft. Please follow the Installation and Upgrade Guides for BizTalk 2006. [See References section at the end of this article.]


For this example we will have a SharePoint library that contains book reviews from several contributors outside the publishing company.  We want all of the reviewers to be able to submit their notes to a single repository where we can index that information. We also would like to catalog the information in way that we can apply security at a granular level.

The book reviews are categorized into folders depending of the type of information stored.  We will initially have 3 types of categories: Medical, Technology, and Fiction.  As we add new categories, we can route those documents to the appropriate folder.  This will help our index server keep track of the documents more easily. 

We will use the Category field name in the xml document to route a document to the appropriate library. Then we will use the ISBN field to give it a name inside the library.

These are the steps that we are going to perform:

·         Setup a SharePoint Library.

·         Create an XML schema that we can use in InfoPath and also in BizTalk.

·         Setup an InfoPath template form to submit those documents.

·         Create a BizTalk 2006 Orchestration to route the documents.

·         Publish the Orchestration as a web service so that it can be consumed from any source.

SharePoint Library Setup

These set of steps will guide you on setting up a test SharePoint site that can be used for this demo.

a) Create a new Form Library: Open the Central Administration site, on the right hand side click on Site Actions, and select Create.

Figure 1

b) Under the Library column, select Form Library.

Figure 2

c) For Form Name, type BookReview. Keep all of the defaults.  Click on Create.

d) After creating the form library, you will be at the BookReview page. Let us add some folders to keep all of the information categorized.  First click on New, then select New Folder.

Figure 3

Give it the name Medical. Click OK. Repeat this same process to create a folder for Fiction and another for Technology.

NOTE: If you make a mistake on naming the folders, you can always click and modified by clicking anywhere in between the name and the next column. Then click Edit Properties and you should be OK.

Figure 4

Your final library should look something similar to this:

Figure 5

XML Schema Definition: In here we will define what information we are getting from the reviewers, as well as more detail information about the book.

Figure 6


Figure 1 BizTalk XSD Viewer




Figure 2 XML Spy Grid view

The Book node will contain the Category and the ISBN fields that we will use to route this document to the appropriate folder in SharePoint.

InfoPath Creation

This is the GUI interface to demonstrate the capabilities of submitting to SharePoint. Go ahead and create a new InfoPath template and specify the schema created earlier, to be the base for this InfoPath form. Drag the fields over and lay them on the form anyway you want.

Publish the template back to SharePoint library created in the first step.  Open InfoPath and design a form. Now, save it and publish it.

Figure 7

For our example, the SharePoint site is called BookReview.

Figure 8

On the next screen, select Document Library, and then click Next. Select to update the form template and select the Document library.

Figure 9

Add a couple of columns so that you can create different views later based on the data stored.

Figure 10

Finally, hit the Publish button and close the Publishing wizard.

Orchestration Creation and Setup

Since we are determining at run time the location of the document in SharePoint, we will use a dynamic port in the Orchestration. This will be determined based on the content of the message.  This type of routing is referred to as Content Based Routing in BizTalk 2006.

Add a new BizTalk project. You will need to add some shapes to the orchestration; below is a sample snapshot of all of the shapes being used for this demo.

Notice that on the orchestration, we are only routing on the Category of the document being submitted.  However, in a real world application, there might be more than one field to be used to determine where the final destination might be. 

This is what the finished orchestration looks like:

Figure 11


Here is a snapshot of the Orchestration tab:

Figure 12


Inside the Construct message we will have the following code.

Listing 1

    1 //Messages are immutable
    2 outMsg = InMsg;
    4 //if the form is found on the library, then overwrite it with this new one.
    5 outMsg(WSS.ConfigOverwrite) = "yes";
    7 //turn this off, if you are to insert the InfoPath PI's to the form.
    8 outMsg(WSS.ConfigOfficeIntegration) = "no";
   10 //set the filename in here
   11 outMsg(WSS.Filename) = InMsg.Book.ISBN + ".xml";
   13 //set the base library in here:
   14 sWSS_SiteLocation = @"wss://evo/BookReview/";

For the PI that you are dynamically creating, add the following.

Listing 2

//adjust the file attachment PI
outMsg(XMLNORM.ProcessingInstructionOption) = 1; 
outMsg(XMLNORM.ProcessingInstruction) =
 "<?mso-infoPathSolution  PIVersion=\"\"

Inside the medical of the Expression shape, we execute this code:

Listing 3

//add the location of the folder in here.
sWSSTargetPathLocation = sWSS_SiteLocation + "Medical";

Then on the last expression shape, labeled Dyn WSS Address, we dynamically set the address where this document is going to be sent. 

Listing 4

//set the destination of the dynamic form based on the criteria above.
WSS_BookReview(Microsoft.XLANGs.BaseTypes.Address) = sWSSTargetPathLocation;
Excluding a Web site from SharePoint manager

Excluding the bookServices web site from SharePoint manager was a mandatory step if you were using WSS 2.0. The default in WSS 3.0 is to exclude all sites by default. See the following snapshots to see this.

Figure 13

On the top tab, select application settings.

Figure 14

Now under the SharePoint Web Application Management group, select the Define managed paths option.

Figure 15

As you can see, there is no option to EXCLUDE the web site.

Figure 16

Deploying BizTalk Orchestration as a Web Service

From the Microsoft BizTalk Server 2006 group, select the BizTalk Web Services Publishing Wizard.  Then select the option to Publish BizTalk Orchestrations.

On the next screen you will be prompted for your project assembly.

Figure 17

Click Next to continue. Keep the defaults on the next screen and select Next. Once you get to the Web Service Properties screen, you will be prompted for the namespace to be used in your web service.

Figure 18

Type: http://BookReview.Demo.Sample/ at this text prompt. Do not forget to put the last "/" at the end. This namespace is NOT the one being used when your document is being submitted to BizTalk; instead, this namespace is mostly used on the WSDL definition.

Now, click Next and you will be at the Web Service Project screen. In here you will specify the name that you want to give to your web service. Select the name of the site that we excluded earlier, bookServices. This is what this screen should look like:

Figure 19

After this screen you will get the Create button, click on it and you will be done with this step. To test that the web service is up and running, you can do the small test of see if IIS will render this site.

In order to tie the WSS and BizTalk, you will need to bind the logical port of the orchestration with the physical ports. This is accomplished by opening the BizTalk 2006 Administration Console. Then open the AW.BookReview application. 

In there, open the Receive Locations and you will see that there is a new location of type SOAP. This location was generated by the Web Service Publishing Wizard we ran before. Now bind your Orchestration ports to the appropriate location. You will only be able to bind Inbound ports to receive ports and outbound ports to send ports.

Figure 20

Notice that we have bound the orchestration logical port to the Web Service receive location. Then bind the outbound logical port of the Orchestration to the Dynamic Soap that will be connected to SharePoint.

Start the Application and it is ready for BizTalk to start processing web services request.



We have shown on this article several advanced techniques to get BizTalk and SharePoint Services connected. As you can see, most of the bulk of the work involved properly configuring the environment and not so much on the coding side. Thanks to Microsoft, the bulk of the work is being done for us in the background. BizTalk provides a good solid foundation for an ESB architecture in which it will be the mediator between external services and internal resources. We have shown that we can use BizTalk in the middle layer to provide for some business rules.

User Comments

Title: Elaborate the Biztalk Orchestration   
Name: Vaibhav Sali
Date: 2010-11-01 8:42:02 AM
Please if possible can you give the clear code view of the orchestration..

Title: Project Manager   
Name: NAz Sha
Date: 2009-04-17 9:00:47 AM
Want more infor on sharepoint and vbiztalk
Title: Elaborate the Biztalk Orch   
Name: PM
Date: 2009-01-26 10:49:37 AM
It would be gr8 if u can elaborate more on each component used in Orchestration and their settings.. Article is gr8 but of little use as the Orch cant be completed without the details.. Pls post the source code for it if its possible
Title: My Thoughts   
Name: Steven Barden
Date: 2007-10-29 11:23:27 AM
Congratulations on such a great article!
Title: Want Code   
Name: Jamil Khan
Date: 2007-07-10 12:52:42 PM
How can i Find the code of above sample plz tell us. Thank in advance.
Title: Great Article   
Name: Brian Prince
Date: 2007-06-06 4:20:44 PM
Great article. At first, I thought it was going to talk about how to get the wssv2 adapter to work with wssv3. I am glad to see you aren't doing that, and are using the wssv3 native web services.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2021  |  Page Processed at 2021-12-05 7:06:24 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search