Introduction
There are several situations in a workflow where human interaction is required; here is when InfoPath 2003 comes into picture. Essentially, InfoPath 2003 is used to create/edit XML documents based on a schema or a template. This template in InfoPath has a [*.xsn] extension. Using InfoPath a template (*.xsn) is created and several instances of XML documents are created based on that template. InfoPath 2003 is available as a part of Office 2003 Enterprise Edition.
Scenario: Loan processing application
In short, we shall be creating a loan processing application in BizTalk and will access this application using InfoPath 2003.
Quick <TODO> list
- Open Visual Studio .NET 2004 and create a new empty BizTalk project.
- Create the Loan Request (input schema) and Loan Response (output schema) schemas.
- Create a map (*.btm) to map the input schema to the output schemas.
- Create the Loan Processing Orchestration (*.odx) and specify the ports, key file and deploy.
- Convert the Loan Processing Orchestration to be accessible as a web service. An orchestration can be activated through a web service call.
- Open InfoPath 2003 and create a new template from the web service. Specify the input and output and finally call the orchestration from the InfoPath form.
Creating the BizTalk project
Create a new BizTalk Server Project in Visual Studio .NET.
Step 1: In the Visual Studio .NET menu, select the File -> New -> Project and type the name "LoanProcessingApplication".
Building the schemas - LoanRequest.xsd and LoanResponse.xsd
Step 2: Right-click on the project in the Solution Explorer and select the "Add New Item" option. Then, select the item "Schema" and name it "LoanRequest
". Add the schema elements and promote the properties as shown in the picture below:
Step 3: Perform 'Step 2' again and name the schema as "LoanResponse
". Add the schema elements and promote the properties as shown in the picture below:
Creating the map
This map transforms data from the 'LoanRequest
' to the 'LoanResponse
' message.
Step 4: Right-click on the project in the Solution Explorer and select the "Add New Item" option. Then, select the item "Map" and name it "LoanRequest-To-LoanResponse-Map
". Select the LoanRequest
and LoanResponse
schemas as the source and destination schemas respectively and map the schemas as shown in the screen shot below:
Building the loan application processing orchestration
This orchestration contains the actual loan application processing logic.
Step 5: Right-click on the project in the Solution Explorer and select the "Add New Item" option. Then, select the item "BizTalk Orchestration" and name it "LoanAppOrchestration
". Place the various shapes used in the orchestration as shown in the picture below. Note: Download the code provided above and observe the orchestration file:
Step 6: Creating the port.
- Right-click on the port surface in the orchestration and select "New Configured Port..."
- Click Next and specify the port name as "
WSLoanPort
" and then click "Next". Specify the properties as shown in the screen shot below:
- Specify the Port Bindings as shown in the screen shot below:
Step 7: Strong name and deployment
- Create a key file using "sn -k LoanKey.snk" in the Visual Studio .NET command prompt.
- In the Solution Explorer, right-click on the "LoanProcessingApplication" project properties and select "Assembly" and specify the key file name.
- In the Solution Explorer, right-click on the "LoanProcessingApplication" project properties and select "Deploy". In the BizTalk Explorer, right-click on the listed orchestration under the "Orchestration" folder and select "Start". The orchestration icon must turn to blue.
Creating a web service out of a BizTalk orchestration
Step 8: Using the BizTalk Web Services Publishing Wizard.
- In the Visual Studio, select Tools -> BizTalk Web Services Publishing Wizard. In the wizard, select "Publish BizTalk Orchestrations as Web Services" and click "Next". Follow the wizard screen shots below:
Step 9: Testing the web service: Test the web service which is generated by the wizard using the URL as shown in the image below:
Using InfoPath 2003
Step 10: Open InfoPath 2003, and select "Design a Form".
- Select the options in the wizard by looking at the screen shots below:
Drag and drop the data source fields on to the InfoPath form and form the layout. See the "Preview" of the InfoPath Form screen shot below:
Step 11: Test the solution.
- Save and Open the XSN file, enter the input values for the loan application and click "Run Query". Note the result values appearing on the InfoPath 2003 form.
Quick takeaways
- Always set the
Activate
property to "true
" for the first Receive shape in the orchestration.
- The access restrictions must be set to "Public" when you want to access the orchestration as a web service, in the Port Configuration Wizard "Select a Port Type" screen.