Walkthrough: Module 2 - Integrating Office with the Windows SharePoint Services Adapter
This walkthrough is a continuation of Walkthrough: Module 1 - Sending and Receiving Messages with the Windows SharePoint Services Adapter and shows you how to integrate Microsoft Office with the BizTalk Server content-based routing (CBR) application you created. For an introduction to the Windows SharePoint Services adapter see What Is the Windows SharePoint Services Adapter?.
Prerequisites
The following are prerequisites for performing the procedures in this topic:
You must have a single-server deployment with a complete installation of BizTalk Server.
You must complete the following walkthrough: Walkthrough: Module 1 - Sending and Receiving Messages with the Windows SharePoint Services Adapter
For information about using the Windows SharePoint Services Adapter in a multiserver deployment, see Setting Up and Deploying the Windows SharePoint Services Adapter.
Create a BizTalk project
In this procedure you create an empty BizTalk project and a schema using the BizTalk Editor. This procedure is required to create the schema for the InfoPath form that is used later.
Create a strong name key file
Start Visual Studio Command Prompt.
Type
sn -k C:\WSSAdapterWalkthrough\OrderProcess.snk
, and then press Enter. The key pair will be written.Close the command prompt.
Create an empty BizTalk project
Start Microsoft Visual Studio.
Click File, New, and then click Project.
Under Project types, select BizTalk Projects.
Under Templates, select Empty BizTalk Server Project.
Type
OrderProcess
in the Name field.Type the file path to your working directory in the Location field. For example,
C:\WSSAdapterWalkthrough\
.Click OK.
Associate the key file with the assembly
In Solution Explorer, right-click the
OrderProcess
project, and then click Properties to launch the Project Designer.Click the Signing tab.
Select Sign the assembly option, click drop-down list for the Choose a strong name key file option, and then click Browse.
Type
C:\WSSAdapterWalkthrough\OrderProcess.snk
.Click Open.
Create an XSD schema by using the BizTalk Editor
In Solution Explorer, right-click the
OrderProcess
project, click Add, and then click New Item.Under Categories, click Schema Files.
Under Templates, click Schema.
Type
OrderProcessSchema
in the Name field, and then click Add.In the Properties Window for
OrderProcessSchema
, selectQualified
for the Element FormDefault property.In the Properties Window for
OrderProcessSchema
, typehttp://OrderProcess.PurchaseOrder
in the Target Namespace field.In the BizTalk Editor, right-click
Root
, click Rename, and then typePurchaseOrder
.Right-click the PurchaseOrder node, click Insert Schema Node, then click Child Field Element.
Name it
PurchaseOrderID
.Create another child field element and name it
BillTo
.Create another child field element and name it
Amount
.In the Properties Window, set the Data Type property for
Amount
to xs:unsignedInt.Create another child field element and name it
PurchaseOrderDate
.In the Properties Window, set the Data Type property for
PurchaseOrderDate
to xs:dateTime.Click File, and then click Save All.
Close Visual Studio.
Create an InfoPath form
In this procedure you create another document library and an InfoPath form based on the schema you created in the last procedure. This InfoPath form will be used to submit a document to BizTalk Server.
Note
This walkthrough requires Microsoft Office InfoPath 2007
Create a new document library
Open a Web browser and navigate to the URL of the site you created. For example,
http://<server_name>/sites/WSSAdapterWalkthrough
.On the top navigation bar, click Create.
Under Document Libraries, click Document Library.
In the Name and Description section, type
InfoPathSolutions
in the Name field.In the Navigation section, select Yes to display this form library on the Quick Launch bar.
In the Document Template section, select
None
for the Document Template.Click Create. You will be redirected to the empty library you just created.
On the left side, click Modify Settings and Columns.
Under Columns, click Add a New Column.
Under Name and Type, type
Namespace
in the Name field.Click OK.
Close the
WSSAdapterWalkthrough
Web site.
Create an InfoPath form based on the OrderProcessSchema schema file
Click Start, point to All Programs, point to Microsoft Office, and then click Microsoft Office InfoPath 2007.
In the Fill Out a Form dialog box, select Design a Form.
In the Design a Form task pane, select New from XML Document or Schema.
In the Data Source Wizard, click Browse and select the schema file you created in the last procedure. For example,
C:\WSSAdapterWalkthrough\OrderProcess\OrderProcess\OrderProcessSchema.xsd
.Click Next, and then click Finish.
In the Data Source task pane, right-click the PurchaseOrder node, and then click Section with Controls. This will create the form on the template.
Click File, click Save, and then click Save.
In the Save As dialog box, type
PurchaseOrder.xsn
in the File name field, and then click Save.Click File, and then click Publish.
In the Publishing Wizard, click Next.
Select To a Web Server, and then click Next.
Type the path and filename to your
InfoPathSolutions
document library, and then click Next. For example,http://<server_name>/sites/WSSAdapterWalkthrough/InfoPathSolutions/PurchaseOrder.xsn
.Click Finish, and then click Close.
Close Microsoft InfoPath.
Modify the SharePoint document libraries
In this procedure you will update the namespace property for the PurchaseOrder.xsn file and modify the Destination Document Library. This namespace is used as a variable when determining subscribers of published documents for content based routing scenarios.
Update the namespace for PurchaseOrder.xsn
Open a Web browser and navigate to the URL of the site you created. For example,
http://<server_name>/sites/WSSAdapterWalkthrough
.On the left side, under Documents, click
InfoPathSolutions
.Move the pointer over
PurchaseOrder.xsn
, right-click it, and then click Edit Properties.Type
http://OrderProcess.PurchaseOrder
in the Namespace field, and then click Save and Close.
Modify the Destination document library
On the top navigation bar, click Documents and Lists.
Under Document Libraries, click Destination.
On the left side, click Modify Settings and Columns.
Under Columns, click Add New Column.
Under Name and Type, type
Partner Name
in the Column name field.Click OK.
Close the
WSSAdapterWalkthrough
Web site.
Modify the send port from walkthrough 1
In this procedure you modify the send port from walkthrough 1. This procedure is required to ensure that the document processed in this walkthrough is correctly routed to the send port.
Modify the send port
Open BizTalk Server Administration.
Expand Microsoft BizTalk Server Administration, expand BizTalk Group, expand Applications, expand BizTalk Application 1, and then click the Send Ports node.
Right-click
SendToDestination
, and then click Properties.Under Transport, click Configure.
In the Filename field, type
PurchaseOrder2-%XPATH=//pons:PurchaseOrder/pons:PurchaseOrderID%.xml
.In the Namespace Aliases field, type
pons="http://OrderProcess.PurchaseOrder"
.In the Templates Document Library, type
InfoPathSolutions
.In the Templates Namespace Column, type
Namespace
.Select
Yes
for the Microsoft Office Integration property.Under Windows SharePoint Services Integration, type
Partner Name
in the Column 01 field.Type
%XPATH=//pons:PurchaseOrder/pons:BillTo%
in the Column 01 Value field, click OK, and then click OK again to exit the Send Port Properties dialog box.
Restart the send port
In the BizTalk Administration Console, click the Send Ports node.
Right-click
SendToDestination
, and then click Unenlist.Right-click
SendToDestination
, and then click Start.Close the BizTalk Administration Console.
Send a message through the system
In this procedure you create an InfoPath form and upload it to the Windows SharePoint Services Web site. The Windows SharePoint Services adapter will take that message, archive it in the Archive document library, and then send it to the Destination document library. This procedure demonstrates how a document flows from a Sharepoint web site, through BizTalk Server, and to a Sharepoint Services Web site using the Windows Sharepoint Services adapter.
Create an InfoPath form to send through the system
Open a Web browser and navigate to the URL of the site you created. For example,
http://<server_name>/sites/WSSAdapterWalkthrough
.On the left side, under Documents, click
InfoPathSolutions
.Click the
PurchaseOrder
file to display the File Download dialog box, and then click Open. InfoPath will load the form.In the Purchase Order ID field, type
1002
.In the Bill To field, type
John Doe
.In the Amount field, type
750
.In the Purchase Order Date field, type
1/2/2005
.Click Save.
In the Save As dialog box, type
http://<server_name>/sites/WSSAdapterWalkthrough/Source
in the file name field, and then hit Enter.Type
PurchaseOrder2.xml
in the file name field, and then click Save.Close Microsoft Office InfoPath.
In the Web browser, on the top navigation bar, click Documents and Lists.
Under Document Libraries, click Destination.
In the Destination document library, you will now see your message listed. You will also find a copy archived in the Archive document library.
In the Destination document library, click
PurchaseOrder1.xml
. Note that this XML file is opened in Microsoft Internet Explorer.In the Destination document library, click
PurchaseOrder2.xml
. Note that this XML file is opened in Microsoft Office InfoPath.
Note
In the Destination document library, the file name column should contain the value of the PurchaseOrderID field and the Partner Name column should contain the value of the BillTo field.
Summary
In this walkthrough you have seen how to add tighter integration with Microsoft InfoPath using the Windows SharePoint Services Adapter and content-based routing (CBR).
Next Steps
Now that you have completed this walkthrough, perform the Walkthrough: Module 3 - Accessing SharePoint Properties from an Orchestration walkthrough which expands on the work you have done with this walkthrough, integrates an orchestration into the project, and shows you how to access SharePoint properties from within it.
See Also
What Is the Windows SharePoint Services Adapter?
Windows SharePoint Services Adapter Walkthroughs